COPASI API  4.16.103
Classes | Macros | Typedefs | Enumerations | Functions | Variables
stdsoap2.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include <time.h>
#include <sys/socket.h>
#include <strings.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
Include dependency graph for stdsoap2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Namespace
 
struct  soap
 
struct  soap_array
 
struct  soap_attribute
 
struct  soap_blist
 
struct  soap_clist
 
struct  soap_code_map
 
struct  soap_cookie
 
struct  soap_dime
 
struct  soap_dom_attribute
 
struct  soap_dom_element
 
struct  soap_double_nan
 
struct  soap_flist
 
struct  soap_ilist
 
struct  soap_mime
 
struct  soap_multipart
 
struct  soap_nlist
 
struct  soap_pblk
 
struct  soap_plist
 
struct  soap_plugin
 
struct  soap_xlist
 

Macros

#define _REENTRANT
 
#define _THREAD_SAFE
 
#define DBGFUN(FNAME)
 
#define DBGFUN1(FNAME, FMT, ARG)
 
#define DBGFUN2(FNAME, FMT1, ARG1, FMT2, ARG2)
 
#define DBGFUN3(FNAME, FMT1, ARG1, FMT2, ARG2, FMT3, ARG3)
 
#define DBGHEX(DBGFILE, MSG, LEN)
 
#define DBGLOG(DBGFILE, CMD)
 
#define DBGMSG(DBGFILE, MSG, LEN)
 
#define DBL_NAN   (*(double*)(void*)&soap_double_nan)
 
#define DBL_NINFTY   (-DBL_PINFTY)
 
#define DBL_PINFTY   (1.7976931348623157e+308)
 
#define FD_SETSIZE   (1024)
 
#define FLT_NAN   (*(float*)(void*)&soap_double_nan)
 
#define FLT_NINFTY   (-FLT_PINFTY)
 
#define FLT_PINFTY   (3.40282347e+38F)
 
#define HAVE_FTIME
 
#define HAVE_GETHOSTBYNAME_R
 
#define HAVE_GMTIME_R
 
#define HAVE_LOCALTIME_R
 
#define HAVE_MBTOWC
 
#define HAVE_RAND_R
 
#define HAVE_SSCANF
 
#define HAVE_STRRCHR
 
#define HAVE_STRTOD
 
#define HAVE_STRTOL
 
#define HAVE_STRTOUL
 
#define HAVE_SYS_TIMEB_H
 
#define HAVE_WCTOMB
 
#define LONG64   long long
 
#define SOAP_BEGIN   0
 
#define SOAP_BEGIN_SECURITY   10
 
#define SOAP_BLKLEN   (256) /* size of blocks to collect long strings and XML attributes */
 
#define SOAP_BUFLEN   (65536) /* buffer length for socket packets, also used by gethostbyname_r and UDP messages, so don't make this too small */
 
#define SOAP_C_MBSTRING   0x00400000 /* (de)serialize strings with multi-byte content */
 
#define SOAP_C_NILSTRING   0x00800000 /* serialize empty strings as nil (omitted) */
 
#define SOAP_C_NOIOB   0x00100000 /* don't fault on array index out of bounds (just ignore) */
 
#define SOAP_C_UTFSTRING   0x00200000 /* (de)serialize strings with UTF8 content */
 
#define soap_check_state(soap)   (!(soap) || ((soap)->state != SOAP_INIT && (soap)->state != SOAP_COPY))
 
#define SOAP_CLI_FAULT   1
 
#define soap_closesocket(n)   close(n)
 
#define soap_clr_imode(soap, n)   ((soap)->imode &= ~(n))
 
#define soap_clr_mode(soap, n)   ((soap)->imode &= ~(n), (soap)->omode &= ~(n))
 
#define soap_clr_omode(soap, n)   ((soap)->omode &= ~(n))
 
#define SOAP_CMAC
 
#define SOAP_COPY   2
 
#define SOAP_DATAENCODINGUNKNOWN   41
 
#define SOAP_DEL_METHOD   17
 
#define soap_destroy(soap)   soap_delete((soap), NULL)
 
#define SOAP_DIME_ABSURI   0x20
 
#define SOAP_DIME_CF   0x01
 
#define SOAP_DIME_END   35
 
#define SOAP_DIME_ERROR   32
 
#define SOAP_DIME_HREF   33
 
#define SOAP_DIME_MB   0x04
 
#define SOAP_DIME_ME   0x02
 
#define SOAP_DIME_MEDIA   0x10
 
#define SOAP_DIME_MISMATCH   34
 
#define SOAP_DIME_VERSION   0x08 /* DIME version 1 */
 
#define SOAP_DOM_ASIS   0x04000000
 
#define SOAP_DOM_NODE   0x02000000
 
#define SOAP_DOM_TREE   0x01000000
 
#define SOAP_DUPLICATE_ID   24
 
#define SOAP_EADDRINUSE   EADDRINUSE
 
#define SOAP_EAGAIN   EAGAIN
 
#define SOAP_EINPROGRESS   EINPROGRESS
 
#define SOAP_EINTR   EINTR
 
#define SOAP_ENC   0x00000FFF /* IO and ENC mask */
 
#define SOAP_ENC_DIME   0x00000080
 
#define SOAP_ENC_LATIN   0x00000020 /* accept iso-8859-1 encoding */
 
#define SOAP_ENC_MIME   0x00000100
 
#define SOAP_ENC_MTOM   0x00000200
 
#define SOAP_ENC_SSL   0x00000800
 
#define SOAP_ENC_XML   0x00000040 /* plain XML encoding, no HTTP header */
 
#define SOAP_ENC_ZLIB   0x00000400
 
#define SOAP_END   9
 
#define SOAP_END_BODY   7
 
#define SOAP_END_ENVELOPE   8
 
#define SOAP_END_HEADER   4
 
#define SOAP_END_SECURITY   12
 
#define SOAP_EOF   EOF
 
#define SOAP_EOM   20
 
#define SOAP_ERANGE   ERANGE
 
#define SOAP_ERR   EOF
 
#define soap_errno   errno
 
#define SOAP_EWOULDBLOCK   EWOULDBLOCK
 
#define SOAP_FATAL_ERROR   11
 
#define SOAP_FAULT   12
 
#define SOAP_FD_EXCEEDED   46
 
#define SOAP_FILE   1003 /* Custom file-based response */
 
#define SOAP_FMAC1
 
#define SOAP_FMAC2
 
#define SOAP_FMAC3
 
#define SOAP_FMAC3S   SOAP_FMAC3
 
#define SOAP_FMAC4
 
#define SOAP_FMAC4S   SOAP_FMAC4
 
#define SOAP_FMAC5
 
#define SOAP_FMAC6
 
#define SOAP_FORM   1001 /* Form request/response */
 
#define SOAP_FREE(soap, ptr)   free(ptr)
 
#define SOAP_GAI_STRERROR   gai_strerror
 
#define SOAP_GET   2001
 
#define soap_get0(soap)   (((soap)->bufidx>=(soap)->buflen && soap_recv(soap)) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx])
 
#define soap_get1(soap)   (((soap)->bufidx>=(soap)->buflen && soap_recv(soap)) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx++])
 
#define SOAP_GET_METHOD   15
 
#define SOAP_HDR   22
 
#define SOAP_HDRLEN   (8192) /* maximum length of HTTP header line (must be >4096 to read cookies) */
 
#define SOAP_HEAD_METHOD   18
 
#define SOAP_HREF   26
 
#define SOAP_HTML   1002 /* Custom HTML response */
 
#define SOAP_HTTP_ERROR   29
 
#define soap_http_error_check(e)   ((e) == SOAP_HTTP_ERROR || ((e) >= SOAP_GET_METHOD && (e) <= SOAP_HTTP_METHOD)|| (e) == SOAP_NO_DATA || ((e) >= 100 && (e) < 600))
 
#define SOAP_HTTP_METHOD   19
 
#define SOAP_IDHASH   (1999) /* prime size of hash table for parsed id/ref */
 
#define soap_imode(soap, n)   ((soap)->mode = (soap)->imode = (n))
 
#define SOAP_IN_BODY   6
 
#define SOAP_IN_ENVELOPE   2
 
#define SOAP_IN_HEADER   3
 
#define SOAP_IN_SECURITY   11
 
#define SOAP_INDEX_RECV   (0)
 
#define SOAP_INDEX_SENT   (1)
 
#define SOAP_INDEX_TEST   (2)
 
#define SOAP_INIT   1
 
#define soap_int32   int32_t
 
#define SOAP_INVALID_SOCKET   ((SOAP_SOCKET)-1)
 
#define SOAP_IO   0x00000003 /* IO mask */
 
#define SOAP_IO_BUFFER   0x00000001 /* buffer output in packets of size SOAP_BUFLEN */
 
#define SOAP_IO_CHUNK   0x00000003 /* use HTTP chunked transfer AND buffer packets */
 
#define SOAP_IO_DEFAULT   SOAP_IO_FLUSH
 
#define SOAP_IO_FLUSH   0x00000000 /* flush output immediately, no buffering */
 
#define SOAP_IO_KEEPALIVE   0x00000010 /* keep connection alive */
 
#define SOAP_IO_LENGTH   0x00000008 /* calc message length (internal) */
 
#define SOAP_IO_STORE   0x00000002 /* store entire output to determine length for transport */
 
#define SOAP_IO_UDP   0x00000004 /* TCP or UDP */
 
#define SOAP_IOB   7
 
#define soap_isnan(n)   (0)
 
#define soap_isninfd(n)   ((n) <= DBL_NINFTY)
 
#define soap_isninff(n)   ((n) <= FLT_NINFTY)
 
#define soap_ispinfd(n)   ((n) >= DBL_PINFTY)
 
#define soap_ispinff(n)   ((n) >= FLT_PINFTY)
 
#define SOAP_LABLEN   (256) /* initial look-aside buffer length */
 
#define SOAP_LENGTH   45
 
#define SOAP_LONG_FORMAT   "%lld" /* printf format for 64 bit ints */
 
#define SOAP_MALLOC(soap, size)   malloc(size)
 
#define SOAP_MAXARRAYSIZE   (1000000)
 
#define SOAP_MAXDIMS   (16) /* maximum array dimensions (array nestings) must be less than 64 to protect soap->tmpbuf */
 
#define SOAP_MAXKEEPALIVE   (100)
 
#define SOAP_MAXLOGS   (3) /* max number of debug logs per struct soap environment */
 
#define SOAP_MIME_END   38
 
#define SOAP_MIME_ERROR   36
 
#define SOAP_MIME_HREF   37
 
#define SOAP_MIME_POSTCHECK   0x10000000 /* MIME flag (internal) */
 
#define SOAP_MISSING_ID   25
 
#define SOAP_MOE   21
 
#define SOAP_MUSTUNDERSTAND   8
 
#define SOAP_NAMESPACE   9
 
#define SOAP_NMAC
 
#define SOAP_NO_BODY   5
 
#define SOAP_NO_DATA   14
 
#define SOAP_NO_METHOD   13
 
#define SOAP_NO_TAG   6
 
#define SOAP_NONE   0
 
#define SOAP_NULL   23
 
#define SOAP_OCCURS   44
 
#define SOAP_OK   0
 
#define soap_omode(soap, n)   ((soap)->mode = (soap)->omode = (n))
 
#define SOAP_PLUGIN_ERROR   40
 
#define SOAP_POST   2000
 
#define SOAP_PROHIBITED   43
 
#define SOAP_PTRBLK   (32) /* block allocation for pointer hash table chains */
 
#define SOAP_PTRHASH   (1024) /* size of pointer analysis hash table (must be power of 2) */
 
#define SOAP_PUT_METHOD   16
 
#define soap_random   rand()
 
#define soap_register_plugin(soap, plugin)   soap_register_plugin_arg(soap, plugin, NULL)
 
#define SOAP_REQUIRED   42
 
#define soap_reset_errno   (errno = 0)
 
#define soap_revget1(soap)   ((soap)->bufidx--)
 
#define soap_set_imode(soap, n)   ((soap)->imode |= (n))
 
#define soap_set_mode(soap, n)   ((soap)->imode |= (n), (soap)->omode |= (n))
 
#define soap_set_omode(soap, n)   ((soap)->omode |= (n))
 
#define soap_soap_error_check(e)   ((e) == SOAP_CLI_FAULT || (e) == SOAP_SVR_FAULT || (e) == SOAP_VERSIONMISMATCH || (e) == SOAP_MUSTUNDERSTAND || (e) == SOAP_FAULT || (e) == SOAP_NO_METHOD)
 
#define SOAP_SOCKET   int
 
#define soap_socket_errno(s)   errno
 
#define SOAP_SOCKLEN_T   size_t
 
#define SOAP_SOURCE_STAMP(str)
 
#define SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE   0x08 /* client does not check the expiration date of the host certificate */
 
#define SOAP_SSL_DEFAULT   (SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION | SOAP_SSLv3_TLSv1)
 
#define SOAP_SSL_ERROR   30
 
#define soap_ssl_error_check(e)   ((e) == SOAP_SSL_ERROR)
 
#define SOAP_SSL_NO_AUTHENTICATION   0x00 /* for testing purposes */
 
#define SOAP_SSL_NO_DEFAULT_CA_PATH   0x10 /* don't use default_verify_paths */
 
#define SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION   0x02 /* server requires client to authenticate */
 
#define SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION   0x01 /* client requires server to authenticate */
 
#define SOAP_SSL_RSA   0x20 /* use RSA */
 
#define SOAP_SSL_SKIP_HOST_CHECK   0x04 /* client does not check the common name of the host in certificate */
 
#define SOAP_SSLv3   0x40 /* SSL v3 only */
 
#define SOAP_SSLv3_TLSv1   0x00 /* SSL v3 and TLS v1 support by default */
 
#define SOAP_STD_API
 
#define SOAP_STOP   1000 /* No HTTP response */
 
#define SOAP_STRCMP   strcmp /* case sensitive XML element/attribute names */
 
#define soap_strrchr(s, t)   strrchr(s, t)
 
#define soap_strtol(s, t, b)   strtol(s, t, b)
 
#define soap_strtoul(s, t, b)   strtoul(s, t, b)
 
#define SOAP_SVR_FAULT   2
 
#define SOAP_SYNTAX_ERROR   5
 
#define SOAP_TAG_MISMATCH   3
 
#define SOAP_TAGLEN   (1024) /* maximum length of XML element tag/attribute name or host/path name + 1 */
 
#define SOAP_TCP_ERROR   28
 
#define soap_tcp_error_check(e)   ((e) == SOAP_EOF || (e) == SOAP_TCP_ERROR)
 
#define SOAP_TLSv1   0x80 /* TLS v1 only */
 
#define SOAP_TYPE   4
 
#define SOAP_UDP_ERROR   27
 
#define SOAP_ULONG_FORMAT   "%llu" /* printf format for unsigned 64 bit ints */
 
#define soap_unget(soap, c)   ((soap)->ahead = c)
 
#define SOAP_USER_ERROR   10
 
#define soap_valid_socket(n)   ((n) != SOAP_INVALID_SOCKET)
 
#define SOAP_VERSIONMISMATCH   39
 
#define SOAP_WINSOCKINT   size_t
 
#define SOAP_XML_CANONICAL   0x00004000 /* EXC C14N canonical XML */
 
#define SOAP_XML_DOM   0x00040000
 
#define soap_xml_error_check(e)   ((e) == SOAP_TAG_MISMATCH || (e) == SOAP_NO_TAG || (e) == SOAP_SYNTAX_ERROR || (e) == SOAP_NAMESPACE || (e) == SOAP_DUPLICATE_ID || (e) == SOAP_MISSING_ID || (e) == SOAP_REQUIRED || (e) == SOAP_PROHIBITED || (e) == SOAP_OCCURS || (e) == SOAP_LENGTH || (e) == SOAP_NULL || (e) == SOAP_HREF)
 
#define SOAP_XML_GRAPH   0x00010000
 
#define SOAP_XML_INDENT   0x00002000 /* emit indented XML */
 
#define SOAP_XML_NIL   0x00020000
 
#define SOAP_XML_SEC   0x00080000 /* reserved for WS security */
 
#define SOAP_XML_STRICT   0x00001000 /* apply strict validation */
 
#define SOAP_XML_TREE   0x00008000 /* emit XML tree (no id/ref) */
 
#define SOAP_ZLIB_DEFLATE   0x01
 
#define SOAP_ZLIB_ERROR   31
 
#define soap_zlib_error_check(e)   ((e) == SOAP_ZLIB_ERROR)
 
#define SOAP_ZLIB_GZIP   0x02
 
#define SOAP_ZLIB_INFLATE   0x02
 
#define SOAP_ZLIB_NONE   0x00
 
#define STDSOAP_H
 
#define ULONG64   unsigned LONG64
 
#define WITH_FAST
 

Typedefs

typedef int32_t soap_mode
 
typedef int32_t soap_wchar
 

Enumerations

enum  soap_mime_encoding {
  SOAP_MIME_NONE, SOAP_MIME_7BIT, SOAP_MIME_8BIT, SOAP_MIME_BINARY,
  SOAP_MIME_QUOTED_PRINTABLE, SOAP_MIME_BASE64, SOAP_MIME_IETF_TOKEN, SOAP_MIME_X_TOKEN
}
 

Functions

int soap_accept (struct soap *)
 
int soap_append_lab (struct soap *, const char *, size_t)
 
int soap_array_begin_out (struct soap *, const char *tag, int id, const char *type, const char *offset)
 
int soap_array_pointer_lookup (struct soap *, const void *p, const struct soap_array *a, int n, int t, struct soap_plist **)
 
int soap_array_reference (struct soap *, const void *p, const struct soap_array *a, int n, int t)
 
int soap_attachment (struct soap *, const char *, int, const void *, const struct soap_array *, const char *, const char *, const char *, int, const char *, int)
 
const char * soap_attr_value (struct soap *soap, const char *name, int flag)
 
int soap_attribute (struct soap *, const char *, const char *)
 
const char * soap_base642s (struct soap *, const char *, char *, size_t, int *)
 
void soap_begin (struct soap *)
 
int soap_begin_count (struct soap *)
 
int soap_begin_recv (struct soap *)
 
int soap_begin_send (struct soap *)
 
int soap_bind (struct soap *, const char *, int, int)
 
size_t soap_block_size (struct soap *, struct soap_blist *)
 
int soap_body_begin_in (struct soap *)
 
int soap_body_begin_out (struct soap *)
 
int soap_body_end_in (struct soap *)
 
int soap_body_end_out (struct soap *)
 
const char * soap_byte2s (struct soap *, char)
 
int soap_check_mime_attachments (struct soap *soap)
 
void soap_check_result (struct soap *, const char *tag)
 
void soap_cleanup (struct soap *)
 
int soap_closesock (struct soap *)
 
void soap_clr_attr (struct soap *soap)
 
void soap_clr_dime (struct soap *)
 
void soap_clr_mime (struct soap *)
 
const struct soap_code_mapsoap_code (const struct soap_code_map *, const char *)
 
long soap_code_bits (const struct soap_code_map *, const char *)
 
long soap_code_int (const struct soap_code_map *, const char *, long)
 
const char * soap_code_list (struct soap *, const struct soap_code_map *, long)
 
const char * soap_code_str (const struct soap_code_map *, long)
 
int soap_connect (struct soap *, const char *, const char *)
 
int soap_connect_command (struct soap *, int, const char *, const char *)
 
struct soapsoap_copy (const struct soap *)
 
struct soapsoap_copy_context (struct soap *, const struct soap *)
 
void soap_copy_stream (struct soap *, struct soap *)
 
const char * soap_current_namespace (struct soap *soap, const char *tag)
 
const char * soap_dateTime2s (struct soap *, time_t)
 
void soap_dealloc (struct soap *, void *)
 
const char * soap_decode_key (char *, size_t, const char *)
 
const char * soap_decode_val (char *, size_t, const char *)
 
void soap_del (struct soap *)
 
void soap_delete (struct soap *, void *)
 
int soap_dime_forward (struct soap *, unsigned char **, int *, char **, char **, char **)
 
char * soap_dime_option (struct soap *, unsigned short, const char *)
 
struct soap_dom_attributesoap_dom_next_attribute (struct soap_dom_attribute *att)
 
struct soap_dom_elementsoap_dom_next_element (struct soap_dom_element *elt)
 
void soap_done (struct soap *)
 
const char * soap_double2s (struct soap *, double)
 
int soap_element (struct soap *, const char *, int, const char *)
 
int soap_element_begin_in (struct soap *, const char *tag, int nillable, const char *type)
 
int soap_element_begin_out (struct soap *, const char *tag, int id, const char *type)
 
int soap_element_end_in (struct soap *, const char *tag)
 
int soap_element_end_out (struct soap *, const char *tag)
 
int soap_element_href (struct soap *, const char *tag, int id, const char *ref, const char *val)
 
int soap_element_id (struct soap *, const char *tag, int id, const void *p, const struct soap_array *a, int d, const char *type, int n)
 
int soap_element_null (struct soap *, const char *tag, int id, const char *type)
 
int soap_element_ref (struct soap *, const char *tag, int id, int href)
 
int soap_element_result (struct soap *, const char *tag)
 
int soap_element_start_end_out (struct soap *, const char *tag)
 
int soap_embed (struct soap *soap, const void *p, const struct soap_array *a, int n, const char *tag, int type)
 
void soap_embedded (struct soap *, const void *p, int t)
 
int soap_embedded_id (struct soap *, int id, const void *p, int t)
 
void soap_end (struct soap *)
 
void soap_end_block (struct soap *, struct soap_blist *)
 
int soap_end_count (struct soap *)
 
int soap_end_recv (struct soap *)
 
int soap_end_send (struct soap *)
 
struct soap_ilistsoap_enter (struct soap *, const char *)
 
int soap_envelope_begin_in (struct soap *)
 
int soap_envelope_begin_out (struct soap *)
 
int soap_envelope_end_in (struct soap *)
 
int soap_envelope_end_out (struct soap *)
 
void soap_fault (struct soap *)
 
const char ** soap_faultcode (struct soap *)
 
const char ** soap_faultdetail (struct soap *)
 
const char ** soap_faultstring (struct soap *)
 
const char ** soap_faultsubcode (struct soap *)
 
void soap_fcopy (struct soap *soap, int st, int tt, void *p, size_t, const void *q, size_t n)
 
char * soap_first_block (struct soap *, struct soap_blist *)
 
const char * soap_float2s (struct soap *, float)
 
int soap_flush (struct soap *)
 
int soap_flush_raw (struct soap *, const char *, size_t)
 
void soap_free (struct soap *)
 
void soap_free_temp (struct soap *)
 
soap_wchar soap_get (struct soap *)
 
const char * soap_get_header_attribute (struct soap *, const char *, const char *)
 
struct soap_multipartsoap_get_mime_attachment (struct soap *soap, void *handle)
 
unsigned char * soap_getbase64 (struct soap *, int *, int)
 
soap_wchar soap_getchar (struct soap *)
 
int soap_getdime (struct soap *)
 
int soap_getdimehdr (struct soap *)
 
int soap_getfault (struct soap *)
 
int soap_getheader (struct soap *)
 
unsigned char * soap_gethex (struct soap *, int *)
 
int soap_getline (struct soap *, char *, int)
 
int soap_getmime (struct soap *)
 
int soap_getmimehdr (struct soap *)
 
int soap_getoffsets (const char *, const int *, int *, int)
 
int soap_getposition (const char *, int *)
 
int soap_getsize (const char *, const char *, int *)
 
int soap_getsizes (const char *, int *, int)
 
soap_wchar soap_getutf8 (struct soap *)
 
size_t soap_hash (const char *)
 
void soap_header (struct soap *)
 
const char * soap_hex2s (struct soap *, const char *, char *, size_t, int *)
 
voidsoap_id_enter (struct soap *, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
 
voidsoap_id_forward (struct soap *, const char *id, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
 
voidsoap_id_lookup (struct soap *, const char *id, void **p, int t, size_t n, unsigned int k)
 
char * soap_inbyte (struct soap *, const char *tag, char *p, const char *, int)
 
time_t * soap_indateTime (struct soap *, const char *tag, time_t *p, const char *, int)
 
double * soap_indouble (struct soap *, const char *tag, double *p, const char *, int)
 
float * soap_infloat (struct soap *, const char *tag, float *p, const char *, int)
 
int * soap_inint (struct soap *, const char *tag, int *p, const char *, int)
 
void soap_init (struct soap *)
 
void soap_init1 (struct soap *, soap_mode)
 
void soap_init2 (struct soap *, soap_mode, soap_mode)
 
char ** soap_inliteral (struct soap *, const char *tag, char **p)
 
long * soap_inlong (struct soap *, const char *tag, long *p, const char *, int)
 
long long * soap_inLONG64 (struct soap *, const char *tag, long long *p, const char *, int)
 
short * soap_inshort (struct soap *, const char *tag, short *p, const char *, int)
 
char ** soap_instring (struct soap *, const char *tag, char **p, const char *, int, int, long, long)
 
const char * soap_int2s (struct soap *, int)
 
unsigned long long * soap_inULONG64 (struct soap *, const char *tag, unsigned long long *p, const char *, int)
 
unsigned char * soap_inunsignedByte (struct soap *, const char *tag, unsigned char *p, const char *, int)
 
unsigned int * soap_inunsignedInt (struct soap *, const char *tag, unsigned int *p, const char *, int)
 
unsigned long * soap_inunsignedLong (struct soap *, const char *tag, unsigned long *p, const char *, int)
 
unsigned short * soap_inunsignedShort (struct soap *, const char *tag, unsigned short *p, const char *, int)
 
wchar_t ** soap_inwliteral (struct soap *, const char *tag, wchar_t **p)
 
wchar_t ** soap_inwstring (struct soap *, const char *tag, wchar_t **p, const char *, int, long, long)
 
int soap_is_embedded (struct soap *, struct soap_plist *)
 
int soap_is_single (struct soap *, struct soap_plist *)
 
struct soap_clistsoap_link (struct soap *, void *, int, int, int(*fdelete)(struct soap_clist *))
 
const char * soap_long2s (struct soap *, long)
 
const char * soap_LONG642s (struct soap *, long long)
 
struct soap_ilistsoap_lookup (struct soap *, const char *)
 
struct soap_nlistsoap_lookup_ns (struct soap *soap, const char *tag, size_t n)
 
voidsoap_lookup_plugin (struct soap *, const char *)
 
int soap_lookup_type (struct soap *, const char *id)
 
voidsoap_malloc (struct soap *, size_t)
 
int soap_match_array (struct soap *, const char *)
 
int soap_match_cid (struct soap *, const char *, const char *)
 
int soap_match_namespace (struct soap *, const char *, const char *, size_t n1, size_t n2)
 
int soap_match_tag (struct soap *, const char *, const char *)
 
int soap_move (struct soap *, long)
 
struct soapsoap_new (void)
 
struct soapsoap_new1 (soap_mode)
 
struct soapsoap_new2 (soap_mode, soap_mode)
 
struct soap_blistsoap_new_block (struct soap *)
 
char * soap_next_block (struct soap *, struct soap_blist *)
 
struct soap_multipartsoap_next_multipart (struct soap_multipart *)
 
int soap_outbyte (struct soap *, const char *tag, int id, const char *p, const char *, int)
 
int soap_outdateTime (struct soap *, const char *tag, int id, const time_t *p, const char *, int)
 
int soap_outdouble (struct soap *, const char *tag, int id, const double *p, const char *, int)
 
int soap_outfloat (struct soap *, const char *tag, int id, const float *p, const char *, int)
 
int soap_outint (struct soap *, const char *tag, int id, const int *p, const char *, int)
 
int soap_outliteral (struct soap *, const char *tag, char *const *p, const char *type)
 
int soap_outlong (struct soap *, const char *tag, int id, const long *p, const char *, int)
 
int soap_outLONG64 (struct soap *, const char *tag, int id, const long long *p, const char *, int)
 
int soap_outshort (struct soap *, const char *tag, int id, const short *p, const char *, int)
 
int soap_outstring (struct soap *, const char *tag, int id, char *const *p, const char *, int)
 
int soap_outULONG64 (struct soap *, const char *tag, int id, const unsigned long long *p, const char *, int)
 
int soap_outunsignedByte (struct soap *, const char *tag, int id, const unsigned char *p, const char *, int)
 
int soap_outunsignedInt (struct soap *, const char *tag, int id, const unsigned int *p, const char *, int)
 
int soap_outunsignedLong (struct soap *, const char *tag, int id, const unsigned long *p, const char *, int)
 
int soap_outunsignedShort (struct soap *, const char *tag, int id, const unsigned short *p, const char *, int)
 
int soap_outwliteral (struct soap *, const char *tag, wchar_t *const *p, const char *type)
 
int soap_outwstring (struct soap *, const char *tag, int id, wchar_t *const *p, const char *, int)
 
int soap_peek_element (struct soap *)
 
int soap_pointer_enter (struct soap *, const void *p, const struct soap_array *a, int n, int t, struct soap_plist **)
 
int soap_pointer_lookup (struct soap *, const void *p, int t, struct soap_plist **)
 
int soap_pointer_lookup_id (struct soap *, void *p, int t, struct soap_plist **)
 
int soap_poll (struct soap *)
 
void soap_pop_block (struct soap *, struct soap_blist *)
 
void soap_pop_namespace (struct soap *)
 
void soap_post_check_mime_attachments (struct soap *soap)
 
void soap_print_fault (struct soap *, FILE *)
 
void soap_print_fault_location (struct soap *, FILE *)
 
voidsoap_push_block (struct soap *, struct soap_blist *, size_t)
 
int soap_push_namespace (struct soap *, const char *, const char *)
 
int soap_putbase64 (struct soap *, const unsigned char *, int)
 
int soap_putdime (struct soap *)
 
int soap_putdimehdr (struct soap *)
 
int soap_putfault (struct soap *)
 
int soap_putheader (struct soap *)
 
int soap_puthex (struct soap *, const unsigned char *, int)
 
int soap_puthttphdr (struct soap *, int status, size_t count)
 
int soap_putmime (struct soap *)
 
int soap_putmimehdr (struct soap *, struct soap_multipart *)
 
char * soap_putoffset (struct soap *, int)
 
char * soap_putoffsets (struct soap *, const int *, int)
 
char * soap_putsize (struct soap *, const char *, int)
 
char * soap_putsizes (struct soap *, const char *, const int *, int)
 
char * soap_putsizesoffsets (struct soap *, const char *, const int *, const int *, int)
 
int soap_pututf8 (struct soap *, unsigned long)
 
const char * soap_QName2s (struct soap *, const char *)
 
int soap_receiver_fault (struct soap *, const char *, const char *)
 
int soap_receiver_fault_subcode (struct soap *, const char *, const char *, const char *)
 
int soap_recv (struct soap *)
 
int soap_recv_empty_response (struct soap *)
 
int soap_recv_fault (struct soap *)
 
int soap_recv_header (struct soap *)
 
int soap_recv_raw (struct soap *)
 
int soap_reference (struct soap *, const void *p, int t)
 
int soap_register_plugin_arg (struct soap *, int(*fcreate)(struct soap *, struct soap_plugin *, void *), void *)
 
int soap_resolve (struct soap *)
 
int soap_response (struct soap *, int)
 
void soap_retry (struct soap *)
 
void soap_revert (struct soap *)
 
char * soap_s2base64 (struct soap *, const unsigned char *, char *, int)
 
int soap_s2byte (struct soap *, const char *, char *)
 
int soap_s2dateTime (struct soap *, const char *, time_t *)
 
int soap_s2double (struct soap *, const char *, double *)
 
int soap_s2float (struct soap *, const char *, float *)
 
char * soap_s2hex (struct soap *, const unsigned char *, char *, int)
 
int soap_s2int (struct soap *, const char *, int *)
 
int soap_s2long (struct soap *, const char *, long *)
 
int soap_s2LONG64 (struct soap *, const char *, long long *)
 
int soap_s2QName (struct soap *, const char *, char **)
 
int soap_s2short (struct soap *, const char *, short *)
 
int soap_s2string (struct soap *, const char *, char **)
 
int soap_s2ULONG64 (struct soap *, const char *, unsigned long long *)
 
int soap_s2unsignedByte (struct soap *, const char *, unsigned char *)
 
int soap_s2unsignedInt (struct soap *, const char *, unsigned int *)
 
int soap_s2unsignedLong (struct soap *, const char *, unsigned long *)
 
int soap_s2unsignedShort (struct soap *, const char *, unsigned short *)
 
int soap_s2wchar (struct soap *, const char *, wchar_t **)
 
char * soap_save_block (struct soap *, struct soap_blist *, char *, int)
 
int soap_send (struct soap *, const char *)
 
int soap_send2 (struct soap *, const char *, const char *)
 
int soap_send3 (struct soap *, const char *, const char *, const char *)
 
int soap_send_empty_response (struct soap *, int status)
 
int soap_send_fault (struct soap *)
 
int soap_send_raw (struct soap *, const char *, size_t)
 
int soap_sender_fault (struct soap *, const char *, const char *)
 
int soap_sender_fault_subcode (struct soap *, const char *, const char *, const char *)
 
void soap_serializefault (struct soap *)
 
void soap_serializeheader (struct soap *)
 
int soap_set_attr (struct soap *soap, const char *name, const char *value)
 
void soap_set_dime (struct soap *)
 
int soap_set_dime_attachment (struct soap *, char *ptr, size_t size, const char *type, const char *id, unsigned short optype, const char *option)
 
void soap_set_embedded (struct soap *, struct soap_plist *)
 
void soap_set_endpoint (struct soap *, const char *)
 
void soap_set_fault (struct soap *)
 
void soap_set_local_namespaces (struct soap *)
 
void soap_set_mime (struct soap *, const char *boundary, const char *start)
 
int soap_set_mime_attachment (struct soap *, char *ptr, size_t size, enum soap_mime_encoding encoding, const char *type, const char *id, const char *location, const char *description)
 
int soap_set_namespaces (struct soap *, const struct Namespace *)
 
int soap_set_receiver_error (struct soap *, const char *, const char *, int)
 
int soap_set_sender_error (struct soap *, const char *, const char *, int)
 
const char * soap_short2s (struct soap *, short)
 
int soap_size (const int *, int)
 
size_t soap_size_block (struct soap *, struct soap_blist *, size_t)
 
char * soap_sprint_fault (struct soap *, char *, size_t)
 
int soap_ssl_accept (struct soap *)
 
int soap_ssl_client_context (struct soap *, unsigned short, const char *, const char *, const char *, const char *, const char *)
 
const char * soap_ssl_error (struct soap *, int)
 
void soap_ssl_init ()
 
int soap_ssl_server_context (struct soap *, unsigned short, const char *, const char *, const char *, const char *, const char *, const char *, const char *)
 
int soap_store_lab (struct soap *, const char *, size_t)
 
char * soap_strdup (struct soap *, const char *)
 
char * soap_string_in (struct soap *, int, long, long)
 
int soap_string_out (struct soap *, const char *s, int flag)
 
const char * soap_strsearch (const char *big, const char *little)
 
int soap_tag_cmp (const char *, const char *)
 
size_t soap_tell (struct soap *)
 
time_t soap_timegm (struct tm *)
 
void soap_track_free (struct soap *, const char *, int, void *)
 
voidsoap_track_malloc (struct soap *, const char *, int, size_t)
 
const char * soap_ULONG642s (struct soap *, unsigned long long)
 
void soap_unlink (struct soap *, const void *)
 
const char * soap_unsignedByte2s (struct soap *, unsigned char)
 
const char * soap_unsignedInt2s (struct soap *, unsigned int)
 
const char * soap_unsignedLong2s (struct soap *, unsigned long)
 
const char * soap_unsignedShort2s (struct soap *, unsigned short)
 
const char * soap_value (struct soap *)
 
const char * soap_wchar2s (struct soap *, const wchar_t *)
 
wchar_t * soap_wstrdup (struct soap *, const wchar_t *)
 
wchar_t * soap_wstring_in (struct soap *, int, long, long)
 
int soap_wstring_out (struct soap *, const wchar_t *s, int flag)
 
int soap_xop_forward (struct soap *, unsigned char **, int *, char **, char **, char **)
 

Variables

struct Namespace namespaces []
 
const struct soap_double_nan soap_double_nan
 

Macro Definition Documentation

#define _REENTRANT

Definition at line 77 of file stdsoap2.h.

#define _THREAD_SAFE

Definition at line 72 of file stdsoap2.h.

#define DBGFUN (   FNAME)

Definition at line 1249 of file stdsoap2.h.

#define DBGFUN1 (   FNAME,
  FMT,
  ARG 
)

Definition at line 1250 of file stdsoap2.h.

#define DBGFUN2 (   FNAME,
  FMT1,
  ARG1,
  FMT2,
  ARG2 
)

Definition at line 1251 of file stdsoap2.h.

#define DBGFUN3 (   FNAME,
  FMT1,
  ARG1,
  FMT2,
  ARG2,
  FMT3,
  ARG3 
)

Definition at line 1252 of file stdsoap2.h.

#define DBGHEX (   DBGFILE,
  MSG,
  LEN 
)

Definition at line 1253 of file stdsoap2.h.

Referenced by soap_dealloc().

#define DBGLOG (   DBGFILE,
  CMD 
)

Definition at line 1247 of file stdsoap2.h.

Referenced by http_parse(), http_response(), soap_accept(), soap_append_lab(), soap_array_pointer_lookup(), soap_array_reference(), soap_attachment(), soap_attribute(), soap_begin(), soap_begin_count(), soap_begin_recv(), soap_begin_send(), soap_bind(), soap_copy_ArrayOf_USCORExsd_USCOREstring(), soap_copy_context(), soap_copy_ns2__checkRegExp(), soap_copy_ns2__checkRegExpResponse(), soap_copy_ns2__getDataResources(), soap_copy_ns2__getDataResourcesResponse(), soap_copy_ns2__getDataTypeDef(), soap_copy_ns2__getDataTypeDefResponse(), soap_copy_ns2__getDataTypePattern(), soap_copy_ns2__getDataTypePatternResponse(), soap_copy_ns2__getDataTypesId(), soap_copy_ns2__getDataTypesIdResponse(), soap_copy_ns2__getDataTypesName(), soap_copy_ns2__getDataTypesNameResponse(), soap_copy_ns2__getDataTypeSynonyms(), soap_copy_ns2__getDataTypeSynonymsResponse(), soap_copy_ns2__getDataTypeURI(), soap_copy_ns2__getDataTypeURIResponse(), soap_copy_ns2__getDataTypeURIs(), soap_copy_ns2__getDataTypeURIsResponse(), soap_copy_ns2__getJavaLibraryVersion(), soap_copy_ns2__getJavaLibraryVersionResponse(), soap_copy_ns2__getLocation(), soap_copy_ns2__getLocationResponse(), soap_copy_ns2__getLocations(), soap_copy_ns2__getLocations_(), soap_copy_ns2__getLocationsResponse(), soap_copy_ns2__getLocationsResponse_(), soap_copy_ns2__getMiriamURI(), soap_copy_ns2__getMiriamURIResponse(), soap_copy_ns2__getName(), soap_copy_ns2__getNameResponse(), soap_copy_ns2__getNames(), soap_copy_ns2__getNamesResponse(), soap_copy_ns2__getOfficialDataTypeURI(), soap_copy_ns2__getOfficialDataTypeURIResponse(), soap_copy_ns2__getResourceInfo(), soap_copy_ns2__getResourceInfoResponse(), soap_copy_ns2__getResourceInstitution(), soap_copy_ns2__getResourceInstitutionResponse(), soap_copy_ns2__getResourceLocation(), soap_copy_ns2__getResourceLocationResponse(), soap_copy_ns2__getServicesInfo(), soap_copy_ns2__getServicesInfoResponse(), soap_copy_ns2__getServicesVersion(), soap_copy_ns2__getServicesVersionResponse(), soap_copy_ns2__getURI(), soap_copy_ns2__getURIResponse(), soap_copy_ns2__isDeprecated(), soap_copy_ns2__isDeprecatedResponse(), soap_copy_SOAP_ENV__Code(), soap_copy_SOAP_ENV__Detail(), soap_copy_SOAP_ENV__Fault(), soap_copy_SOAP_ENV__Header(), soap_copy_SOAP_ENV__Reason(), soap_copy_std__string(), soap_count_attachments(), soap_dealloc(), soap_delete(), soap_done(), soap_element(), soap_element_begin_in(), soap_element_end_in(), soap_element_end_out(), soap_element_href(), soap_element_start_end_out(), soap_embedded(), soap_embedded_id(), soap_end_block(), soap_end_count(), soap_end_recv(), soap_end_send(), soap_fcopy(), soap_first_block(), soap_flush(), soap_free_iht(), soap_free_ns(), soap_free_pht(), soap_free_temp(), soap_get_mime_attachment(), soap_get_pi(), soap_getchunkchar(), soap_getdimehdr(), soap_getmimehdr(), soap_id_enter(), soap_id_forward(), soap_id_lookup(), soap_ignore_element(), soap_init(), soap_init_iht(), soap_init_pht(), soap_instantiate_ArrayOf_USCORExsd_USCOREstring(), soap_instantiate_ns2__checkRegExp(), soap_instantiate_ns2__checkRegExpResponse(), soap_instantiate_ns2__getDataResources(), soap_instantiate_ns2__getDataResourcesResponse(), soap_instantiate_ns2__getDataTypeDef(), soap_instantiate_ns2__getDataTypeDefResponse(), soap_instantiate_ns2__getDataTypePattern(), soap_instantiate_ns2__getDataTypePatternResponse(), soap_instantiate_ns2__getDataTypesId(), soap_instantiate_ns2__getDataTypesIdResponse(), soap_instantiate_ns2__getDataTypesName(), soap_instantiate_ns2__getDataTypesNameResponse(), soap_instantiate_ns2__getDataTypeSynonyms(), soap_instantiate_ns2__getDataTypeSynonymsResponse(), soap_instantiate_ns2__getDataTypeURI(), soap_instantiate_ns2__getDataTypeURIResponse(), soap_instantiate_ns2__getDataTypeURIs(), soap_instantiate_ns2__getDataTypeURIsResponse(), soap_instantiate_ns2__getJavaLibraryVersion(), soap_instantiate_ns2__getJavaLibraryVersionResponse(), soap_instantiate_ns2__getLocation(), soap_instantiate_ns2__getLocationResponse(), soap_instantiate_ns2__getLocations(), soap_instantiate_ns2__getLocations_(), soap_instantiate_ns2__getLocationsResponse(), soap_instantiate_ns2__getLocationsResponse_(), soap_instantiate_ns2__getMiriamURI(), soap_instantiate_ns2__getMiriamURIResponse(), soap_instantiate_ns2__getName(), soap_instantiate_ns2__getNameResponse(), soap_instantiate_ns2__getNames(), soap_instantiate_ns2__getNamesResponse(), soap_instantiate_ns2__getOfficialDataTypeURI(), soap_instantiate_ns2__getOfficialDataTypeURIResponse(), soap_instantiate_ns2__getResourceInfo(), soap_instantiate_ns2__getResourceInfoResponse(), soap_instantiate_ns2__getResourceInstitution(), soap_instantiate_ns2__getResourceInstitutionResponse(), soap_instantiate_ns2__getResourceLocation(), soap_instantiate_ns2__getResourceLocationResponse(), soap_instantiate_ns2__getServicesInfo(), soap_instantiate_ns2__getServicesInfoResponse(), soap_instantiate_ns2__getServicesVersion(), soap_instantiate_ns2__getServicesVersionResponse(), soap_instantiate_ns2__getURI(), soap_instantiate_ns2__getURIResponse(), soap_instantiate_ns2__isDeprecated(), soap_instantiate_ns2__isDeprecatedResponse(), soap_instantiate_SOAP_ENV__Code(), soap_instantiate_SOAP_ENV__Detail(), soap_instantiate_SOAP_ENV__Fault(), soap_instantiate_SOAP_ENV__Header(), soap_instantiate_SOAP_ENV__Reason(), soap_instantiate_std__string(), soap_is_embedded(), soap_lookup_type(), soap_match_array(), soap_match_tag(), soap_move(), soap_new_block(), soap_next_block(), soap_pointer_enter(), soap_pointer_lookup(), soap_poll(), soap_pop_block(), soap_pop_namespace(), soap_push_block(), soap_push_namespace(), soap_push_ns(), soap_putdime(), soap_putdimehdr(), soap_putmime(), soap_putmimehdr(), soap_recv(), soap_recv_fault(), soap_recv_raw(), soap_reference(), soap_register_plugin_arg(), soap_resolve(), soap_resolve_attachment(), soap_revert(), soap_s2QName(), soap_save_block(), soap_send_fault(), soap_set_attr(), soap_string_in(), soap_try_connect_command(), soap_unlink(), soap_update_ptrs(), soap_utilize_ns(), soap_value(), soap_wstring_in(), tcp_closesocket(), tcp_connect(), tcp_disconnect(), tcp_gethost(), and tcp_shutdownsocket().

#define DBGMSG (   DBGFILE,
  MSG,
  LEN 
)

Definition at line 1248 of file stdsoap2.h.

Referenced by soap_end_send(), soap_flush_raw(), soap_getchunkchar(), and soap_recv_raw().

#define DBL_NAN   (*(double*)(void*)&soap_double_nan)

Definition at line 957 of file stdsoap2.h.

Referenced by soap_s2double().

#define DBL_NINFTY   (-DBL_PINFTY)

Definition at line 975 of file stdsoap2.h.

Referenced by soap_s2double().

#define DBL_PINFTY   (1.7976931348623157e+308)

Definition at line 970 of file stdsoap2.h.

Referenced by soap_s2double().

#define FD_SETSIZE   (1024)

Definition at line 705 of file stdsoap2.h.

Referenced by frecv(), and fsend().

#define FLT_NAN   (*(float*)(void*)&soap_double_nan)

Definition at line 935 of file stdsoap2.h.

Referenced by soap_s2float().

#define FLT_NINFTY   (-FLT_PINFTY)

Definition at line 953 of file stdsoap2.h.

Referenced by soap_s2float().

#define FLT_PINFTY   (3.40282347e+38F)

Definition at line 948 of file stdsoap2.h.

Referenced by soap_s2float().

#define HAVE_FTIME

Definition at line 469 of file stdsoap2.h.

#define HAVE_GETHOSTBYNAME_R

Definition at line 471 of file stdsoap2.h.

#define HAVE_GMTIME_R

Definition at line 472 of file stdsoap2.h.

#define HAVE_LOCALTIME_R

Definition at line 473 of file stdsoap2.h.

#define HAVE_MBTOWC

Definition at line 475 of file stdsoap2.h.

#define HAVE_RAND_R

Definition at line 470 of file stdsoap2.h.

#define HAVE_SSCANF

Definition at line 465 of file stdsoap2.h.

#define HAVE_STRRCHR

Definition at line 463 of file stdsoap2.h.

#define HAVE_STRTOD

Definition at line 464 of file stdsoap2.h.

#define HAVE_STRTOL

Definition at line 466 of file stdsoap2.h.

#define HAVE_STRTOUL

Definition at line 467 of file stdsoap2.h.

#define HAVE_SYS_TIMEB_H

Definition at line 468 of file stdsoap2.h.

#define HAVE_WCTOMB

Definition at line 474 of file stdsoap2.h.

#define LONG64   long long

Definition at line 733 of file stdsoap2.h.

Referenced by soap_inLONG64().

#define SOAP_BEGIN   0

Definition at line 1154 of file stdsoap2.h.

Referenced by soap_begin_count(), soap_begin_recv(), and soap_begin_send().

#define SOAP_BEGIN_SECURITY   10

Definition at line 1163 of file stdsoap2.h.

Referenced by soap_element(), and soap_set_attr().

#define SOAP_BLKLEN   (256) /* size of blocks to collect long strings and XML attributes */
#define SOAP_BUFLEN   (65536) /* buffer length for socket packets, also used by gethostbyname_r and UDP messages, so don't make this too small */
#define SOAP_C_MBSTRING   0x00400000 /* (de)serialize strings with multi-byte content */

Definition at line 1118 of file stdsoap2.h.

Referenced by soap_string_in(), and soap_string_out().

#define SOAP_C_NILSTRING   0x00800000 /* serialize empty strings as nil (omitted) */

Definition at line 1119 of file stdsoap2.h.

Referenced by soap_out_std__string(), soap_outstring(), and soap_outwstring().

#define SOAP_C_NOIOB   0x00100000 /* don't fault on array index out of bounds (just ignore) */

Definition at line 1116 of file stdsoap2.h.

#define SOAP_C_UTFSTRING   0x00200000 /* (de)serialize strings with UTF8 content */

Definition at line 1117 of file stdsoap2.h.

Referenced by soap_s2string(), soap_string_in(), and soap_string_out().

#define soap_check_state (   soap)    (!(soap) || ((soap)->state != SOAP_INIT && (soap)->state != SOAP_COPY))
#define SOAP_CLI_FAULT   1

Definition at line 996 of file stdsoap2.h.

Referenced by soap_recv_fault(), and soap_set_fault().

#define soap_closesocket (   n)    close(n)

Definition at line 693 of file stdsoap2.h.

Referenced by tcp_closesocket().

#define soap_clr_imode (   soap,
 
)    ((soap)->imode &= ~(n))

Definition at line 1904 of file stdsoap2.h.

#define soap_clr_mode (   soap,
 
)    ((soap)->imode &= ~(n), (soap)->omode &= ~(n))

Definition at line 1909 of file stdsoap2.h.

#define soap_clr_omode (   soap,
 
)    ((soap)->omode &= ~(n))

Definition at line 1907 of file stdsoap2.h.

#define SOAP_CMAC

Definition at line 114 of file stdsoap2.h.

#define SOAP_COPY   2

Definition at line 1148 of file stdsoap2.h.

Referenced by soap_copy_context().

#define SOAP_DATAENCODINGUNKNOWN   41

Definition at line 1036 of file stdsoap2.h.

Referenced by soap_set_fault().

#define SOAP_DEL_METHOD   17

Definition at line 1012 of file stdsoap2.h.

Referenced by http_del().

#define soap_destroy (   soap)    soap_delete((soap), NULL)

Definition at line 1910 of file stdsoap2.h.

#define SOAP_DIME_ABSURI   0x20

Definition at line 1073 of file stdsoap2.h.

Referenced by soap_envelope_end_out().

#define SOAP_DIME_CF   0x01

Definition at line 1068 of file stdsoap2.h.

Referenced by soap_begin_recv(), soap_getdime(), soap_putdime(), and soap_recv().

#define SOAP_DIME_END   35

Definition at line 1030 of file stdsoap2.h.

Referenced by soap_getdime(), soap_getdimehdr(), and soap_set_fault().

#define SOAP_DIME_ERROR   32

Definition at line 1027 of file stdsoap2.h.

Referenced by soap_set_fault().

#define SOAP_DIME_HREF   33

Definition at line 1028 of file stdsoap2.h.

Referenced by soap_end_recv(), and soap_set_fault().

#define SOAP_DIME_MB   0x04

Definition at line 1070 of file stdsoap2.h.

Referenced by soap_begin_recv(), soap_envelope_end_out(), and soap_putdime().

#define SOAP_DIME_ME   0x02

Definition at line 1069 of file stdsoap2.h.

Referenced by soap_envelope_end_out(), soap_getdimehdr(), and soap_putdime().

#define SOAP_DIME_MEDIA   0x10

Definition at line 1072 of file stdsoap2.h.

Referenced by soap_putdime().

#define SOAP_DIME_MISMATCH   34

Definition at line 1029 of file stdsoap2.h.

Referenced by soap_getdimehdr(), and soap_set_fault().

#define SOAP_DIME_VERSION   0x08 /* DIME version 1 */

Definition at line 1071 of file stdsoap2.h.

Referenced by soap_begin_recv(), soap_getdimehdr(), soap_putdime(), and soap_putdimehdr().

#define SOAP_DOM_ASIS   0x04000000

Definition at line 1123 of file stdsoap2.h.

Referenced by soap_element().

#define SOAP_DOM_NODE   0x02000000

Definition at line 1122 of file stdsoap2.h.

#define SOAP_DOM_TREE   0x01000000

Definition at line 1121 of file stdsoap2.h.

#define SOAP_DUPLICATE_ID   24

Definition at line 1019 of file stdsoap2.h.

Referenced by soap_id_enter(), and soap_set_fault().

#define SOAP_EADDRINUSE   EADDRINUSE

Definition at line 780 of file stdsoap2.h.

Referenced by tcp_connect().

#define SOAP_EAGAIN   EAGAIN

Definition at line 779 of file stdsoap2.h.

Referenced by frecv(), fsend(), soap_accept(), and tcp_connect().

#define SOAP_EINPROGRESS   EINPROGRESS

Definition at line 786 of file stdsoap2.h.

Referenced by tcp_connect().

#define SOAP_EINTR   EINTR

Definition at line 778 of file stdsoap2.h.

Referenced by frecv(), fsend(), soap_accept(), soap_poll(), tcp_connect(), and tcp_disconnect().

#define SOAP_ENC   0x00000FFF /* IO and ENC mask */

Definition at line 1105 of file stdsoap2.h.

Referenced by tcp_connect().

#define SOAP_ENC_DIME   0x00000080
#define SOAP_ENC_LATIN   0x00000020 /* accept iso-8859-1 encoding */

Definition at line 1097 of file stdsoap2.h.

Referenced by soap_get_pi(), soap_getutf8(), soap_s2string(), soap_s2wchar(), and soap_string_in().

#define SOAP_ENC_MIME   0x00000100
#define SOAP_ENC_MTOM   0x00000200
#define SOAP_ENC_SSL   0x00000800

Definition at line 1103 of file stdsoap2.h.

Referenced by http_parse_header(), soap_poll(), and tcp_connect().

#define SOAP_ENC_XML   0x00000040 /* plain XML encoding, no HTTP header */
#define SOAP_ENC_ZLIB   0x00000400
#define SOAP_END   9

Definition at line 1162 of file stdsoap2.h.

Referenced by soap_begin(), soap_end_recv(), and soap_end_send().

#define SOAP_END_BODY   7

Definition at line 1160 of file stdsoap2.h.

Referenced by soap_body_end_in(), and soap_body_end_out().

#define SOAP_END_ENVELOPE   8

Definition at line 1161 of file stdsoap2.h.

Referenced by soap_envelope_end_in(), and soap_envelope_end_out().

#define SOAP_END_HEADER   4

Definition at line 1157 of file stdsoap2.h.

Referenced by soap_getheader(), and soap_putheader().

#define SOAP_END_SECURITY   12

Definition at line 1165 of file stdsoap2.h.

#define SOAP_EOF   EOF
#define SOAP_EOM   20

Definition at line 1015 of file stdsoap2.h.

Referenced by http_post(), http_response(), soap_append_lab(), soap_attachment(), soap_dime_forward(), soap_flush_raw(), soap_get_mime_attachment(), soap_getattrval(), soap_getdime(), soap_getdimefield(), soap_getmimehdr(), soap_id_forward(), soap_instantiate_ArrayOf_USCORExsd_USCOREstring(), soap_instantiate_ns2__checkRegExp(), soap_instantiate_ns2__checkRegExpResponse(), soap_instantiate_ns2__getDataResources(), soap_instantiate_ns2__getDataResourcesResponse(), soap_instantiate_ns2__getDataTypeDef(), soap_instantiate_ns2__getDataTypeDefResponse(), soap_instantiate_ns2__getDataTypePattern(), soap_instantiate_ns2__getDataTypePatternResponse(), soap_instantiate_ns2__getDataTypesId(), soap_instantiate_ns2__getDataTypesIdResponse(), soap_instantiate_ns2__getDataTypesName(), soap_instantiate_ns2__getDataTypesNameResponse(), soap_instantiate_ns2__getDataTypeSynonyms(), soap_instantiate_ns2__getDataTypeSynonymsResponse(), soap_instantiate_ns2__getDataTypeURI(), soap_instantiate_ns2__getDataTypeURIResponse(), soap_instantiate_ns2__getDataTypeURIs(), soap_instantiate_ns2__getDataTypeURIsResponse(), soap_instantiate_ns2__getJavaLibraryVersion(), soap_instantiate_ns2__getJavaLibraryVersionResponse(), soap_instantiate_ns2__getLocation(), soap_instantiate_ns2__getLocationResponse(), soap_instantiate_ns2__getLocations(), soap_instantiate_ns2__getLocations_(), soap_instantiate_ns2__getLocationsResponse(), soap_instantiate_ns2__getLocationsResponse_(), soap_instantiate_ns2__getMiriamURI(), soap_instantiate_ns2__getMiriamURIResponse(), soap_instantiate_ns2__getName(), soap_instantiate_ns2__getNameResponse(), soap_instantiate_ns2__getNames(), soap_instantiate_ns2__getNamesResponse(), soap_instantiate_ns2__getOfficialDataTypeURI(), soap_instantiate_ns2__getOfficialDataTypeURIResponse(), soap_instantiate_ns2__getResourceInfo(), soap_instantiate_ns2__getResourceInfoResponse(), soap_instantiate_ns2__getResourceInstitution(), soap_instantiate_ns2__getResourceInstitutionResponse(), soap_instantiate_ns2__getResourceLocation(), soap_instantiate_ns2__getResourceLocationResponse(), soap_instantiate_ns2__getServicesInfo(), soap_instantiate_ns2__getServicesInfoResponse(), soap_instantiate_ns2__getServicesVersion(), soap_instantiate_ns2__getServicesVersionResponse(), soap_instantiate_ns2__getURI(), soap_instantiate_ns2__getURIResponse(), soap_instantiate_ns2__isDeprecated(), soap_instantiate_ns2__isDeprecatedResponse(), soap_instantiate_SOAP_ENV__Code(), soap_instantiate_SOAP_ENV__Detail(), soap_instantiate_SOAP_ENV__Fault(), soap_instantiate_SOAP_ENV__Header(), soap_instantiate_SOAP_ENV__Reason(), soap_instantiate_std__string(), soap_malloc(), soap_new_block(), soap_peek_element(), soap_pointer_enter(), soap_push_block(), soap_push_namespace(), soap_push_ns(), soap_register_plugin_arg(), soap_s2string(), soap_save_block(), soap_set_attr(), soap_set_dime_attachment(), soap_set_fault(), and soap_set_mime_attachment().

#define SOAP_ERANGE   ERANGE
#define SOAP_ERR   EOF
#define soap_errno   errno
#define SOAP_EWOULDBLOCK   EWOULDBLOCK

Definition at line 785 of file stdsoap2.h.

Referenced by frecv(), fsend(), soap_accept(), and tcp_connect().

#define SOAP_FATAL_ERROR   11

Definition at line 1006 of file stdsoap2.h.

Referenced by soap_set_fault().

#define SOAP_FAULT   12

Definition at line 1007 of file stdsoap2.h.

Referenced by soap_copy_fault(), soap_recv_fault(), and soap_set_fault().

#define SOAP_FD_EXCEEDED   46

Definition at line 1041 of file stdsoap2.h.

Referenced by frecv(), fsend(), soap_accept(), soap_poll(), soap_set_fault(), and tcp_connect().

#define SOAP_FILE   1003 /* Custom file-based response */

Definition at line 1059 of file stdsoap2.h.

Referenced by http_response(), soap_puthttphdr(), and soap_response().

#define SOAP_FMAC1

Definition at line 82 of file stdsoap2.h.

#define SOAP_FMAC2

Definition at line 86 of file stdsoap2.h.

#define SOAP_FMAC3

Definition at line 90 of file stdsoap2.h.

#define SOAP_FMAC3S   SOAP_FMAC3

Definition at line 94 of file stdsoap2.h.

#define SOAP_FMAC4

Definition at line 98 of file stdsoap2.h.

#define SOAP_FMAC4S   SOAP_FMAC4

Definition at line 102 of file stdsoap2.h.

#define SOAP_FMAC5

Definition at line 106 of file stdsoap2.h.

#define SOAP_FMAC6

Definition at line 110 of file stdsoap2.h.

#define SOAP_FORM   1001 /* Form request/response */

Definition at line 1057 of file stdsoap2.h.

Referenced by soap_begin_recv().

#define SOAP_FREE (   soap,
  ptr 
)    free(ptr)
#define SOAP_GAI_STRERROR   gai_strerror

Definition at line 701 of file stdsoap2.h.

Referenced by soap_bind(), and tcp_connect().

#define SOAP_GET   2001

Definition at line 1064 of file stdsoap2.h.

Referenced by http_post(), and soap_puthttphdr().

#define soap_get0 (   soap)    (((soap)->bufidx>=(soap)->buflen && soap_recv(soap)) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx])

Definition at line 1892 of file stdsoap2.h.

Referenced by soap_begin_recv(), soap_get(), and soap_getline().

#define soap_get1 (   soap)    (((soap)->bufidx>=(soap)->buflen && soap_recv(soap)) ? EOF : (unsigned char)(soap)->buf[(soap)->bufidx++])
#define SOAP_GET_METHOD   15

Definition at line 1010 of file stdsoap2.h.

Referenced by http_get(), and soap_set_fault().

#define SOAP_HDR   22

Definition at line 1017 of file stdsoap2.h.

Referenced by soap_getline(), and soap_set_fault().

#define SOAP_HDRLEN   (8192) /* maximum length of HTTP header line (must be >4096 to read cookies) */

Definition at line 855 of file stdsoap2.h.

Referenced by http_parse().

#define SOAP_HEAD_METHOD   18

Definition at line 1013 of file stdsoap2.h.

Referenced by http_head(), and soap_set_fault().

#define SOAP_HREF   26

Definition at line 1021 of file stdsoap2.h.

Referenced by soap_id_enter(), soap_id_forward(), soap_id_lookup(), and soap_set_fault().

#define SOAP_HTML   1002 /* Custom HTML response */

Definition at line 1058 of file stdsoap2.h.

Referenced by http_response(), soap_puthttphdr(), and soap_response().

#define SOAP_HTTP_ERROR   29

Definition at line 1024 of file stdsoap2.h.

Referenced by soap_set_fault().

#define soap_http_error_check (   e)    ((e) == SOAP_HTTP_ERROR || ((e) >= SOAP_GET_METHOD && (e) <= SOAP_HTTP_METHOD)|| (e) == SOAP_NO_DATA || ((e) >= 100 && (e) < 600))

Definition at line 1048 of file stdsoap2.h.

#define SOAP_HTTP_METHOD   19

Definition at line 1014 of file stdsoap2.h.

Referenced by http_parse(), and soap_set_fault().

#define SOAP_IDHASH   (1999) /* prime size of hash table for parsed id/ref */
#define soap_imode (   soap,
 
)    ((soap)->mode = (soap)->imode = (n))
#define SOAP_IN_BODY   6

Definition at line 1159 of file stdsoap2.h.

Referenced by soap_body_begin_in(), soap_body_begin_out(), and soap_element().

#define SOAP_IN_ENVELOPE   2

Definition at line 1155 of file stdsoap2.h.

Referenced by soap_envelope_begin_in(), and soap_envelope_begin_out().

#define SOAP_IN_HEADER   3
#define SOAP_IN_SECURITY   11

Definition at line 1164 of file stdsoap2.h.

Referenced by soap_element().

#define SOAP_INDEX_RECV   (0)

Definition at line 870 of file stdsoap2.h.

Referenced by soap_copy_context().

#define SOAP_INDEX_SENT   (1)

Definition at line 871 of file stdsoap2.h.

Referenced by soap_copy_context().

#define SOAP_INDEX_TEST   (2)

Definition at line 872 of file stdsoap2.h.

Referenced by soap_copy_context().

#define SOAP_INIT   1

Definition at line 1147 of file stdsoap2.h.

Referenced by soap_done(), and soap_init().

#define soap_int32   int32_t

Definition at line 766 of file stdsoap2.h.

Referenced by tcp_gethost().

#define SOAP_INVALID_SOCKET   ((SOAP_SOCKET)-1)

Definition at line 697 of file stdsoap2.h.

Referenced by soap_accept(), soap_bind(), soap_done(), soap_init(), tcp_connect(), and tcp_disconnect().

#define SOAP_IO   0x00000003 /* IO mask */
#define SOAP_IO_BUFFER   0x00000001 /* buffer output in packets of size SOAP_BUFLEN */
#define SOAP_IO_CHUNK   0x00000003 /* use HTTP chunked transfer AND buffer packets */
#define SOAP_IO_DEFAULT   SOAP_IO_FLUSH
#define SOAP_IO_FLUSH   0x00000000 /* flush output immediately, no buffering */
#define SOAP_IO_KEEPALIVE   0x00000010 /* keep connection alive */
#define SOAP_IO_LENGTH   0x00000008 /* calc message length (internal) */

Definition at line 1094 of file stdsoap2.h.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), soap_attachment(), soap_begin_count(), soap_begin_send(), soap_embedded_id(), soap_envelope_begin_out(), soap_envelope_end_out(), soap_is_embedded(), soap_is_single(), soap_send_fault(), soap_send_raw(), and soap_set_embedded().

#define SOAP_IO_STORE   0x00000002 /* store entire output to determine length for transport */
#define SOAP_IO_UDP   0x00000004 /* TCP or UDP */
#define SOAP_IOB   7

Definition at line 1002 of file stdsoap2.h.

Referenced by soap_in_ArrayOf_USCORExsd_USCOREstring(), and soap_set_fault().

#define soap_isnan (   n)    (0)

Definition at line 982 of file stdsoap2.h.

Referenced by soap_double2s(), and soap_float2s().

#define soap_isninfd (   n)    ((n) <= DBL_NINFTY)

Definition at line 988 of file stdsoap2.h.

Referenced by soap_double2s().

#define soap_isninff (   n)    ((n) <= FLT_NINFTY)

Definition at line 989 of file stdsoap2.h.

Referenced by soap_float2s().

#define soap_ispinfd (   n)    ((n) >= DBL_PINFTY)

Definition at line 986 of file stdsoap2.h.

Referenced by soap_double2s().

#define soap_ispinff (   n)    ((n) >= FLT_PINFTY)

Definition at line 987 of file stdsoap2.h.

Referenced by soap_float2s().

#define SOAP_LABLEN   (256) /* initial look-aside buffer length */

Definition at line 820 of file stdsoap2.h.

Referenced by soap_append_lab(), and soap_peek_element().

#define SOAP_LENGTH   45

Definition at line 1040 of file stdsoap2.h.

Referenced by soap_set_fault(), soap_string_in(), and soap_wstring_in().

#define SOAP_LONG_FORMAT   "%lld" /* printf format for 64 bit ints */

Definition at line 746 of file stdsoap2.h.

Referenced by soap_LONG642s(), and soap_s2LONG64().

#define SOAP_MALLOC (   soap,
  size 
)    malloc(size)
#define SOAP_MAXARRAYSIZE   (1000000)

Definition at line 884 of file stdsoap2.h.

Referenced by soap_getsize(), and soap_getsizes().

#define SOAP_MAXDIMS   (16) /* maximum array dimensions (array nestings) must be less than 64 to protect soap->tmpbuf */

Definition at line 862 of file stdsoap2.h.

Referenced by soap_getposition().

#define SOAP_MAXKEEPALIVE   (100)

Definition at line 877 of file stdsoap2.h.

Referenced by soap_init().

#define SOAP_MAXLOGS   (3) /* max number of debug logs per struct soap environment */

Definition at line 869 of file stdsoap2.h.

Referenced by soap_done(), and soap_init_logs().

#define SOAP_MIME_END   38

Definition at line 1033 of file stdsoap2.h.

Referenced by soap_set_fault().

#define SOAP_MIME_ERROR   36

Definition at line 1031 of file stdsoap2.h.

Referenced by soap_get_mime_attachment(), soap_getmimehdr(), and soap_set_fault().

#define SOAP_MIME_HREF   37

Definition at line 1032 of file stdsoap2.h.

Referenced by soap_end_recv(), and soap_set_fault().

#define SOAP_MIME_POSTCHECK   0x10000000 /* MIME flag (internal) */
#define SOAP_MISSING_ID   25

Definition at line 1020 of file stdsoap2.h.

Referenced by soap_resolve(), and soap_set_fault().

#define SOAP_MOE   21

Definition at line 1016 of file stdsoap2.h.

Referenced by soap_dealloc(), and soap_set_fault().

#define SOAP_MUSTUNDERSTAND   8

Definition at line 1003 of file stdsoap2.h.

Referenced by soap_ignore_element(), soap_recv_fault(), and soap_set_fault().

#define SOAP_NAMESPACE   9
#define SOAP_NMAC

Definition at line 118 of file stdsoap2.h.

#define SOAP_NO_BODY   5

Definition at line 1158 of file stdsoap2.h.

Referenced by soap_body_begin_in(), and soap_body_end_in().

#define SOAP_NO_DATA   14

Definition at line 1009 of file stdsoap2.h.

Referenced by soap_begin_recv(), soap_recv_empty_response(), and soap_set_fault().

#define SOAP_NO_METHOD   13

Definition at line 1008 of file stdsoap2.h.

Referenced by soap_set_fault().

#define SOAP_NO_TAG   6

Definition at line 1001 of file stdsoap2.h.

Referenced by soap_element_begin_in(), soap_element_end_in(), soap_getindependent(), soap_ignore_element(), soap_in_ArrayOf_USCORExsd_USCOREstring(), soap_in_ns2__checkRegExp(), soap_in_ns2__checkRegExpResponse(), soap_in_ns2__getDataResources(), soap_in_ns2__getDataResourcesResponse(), soap_in_ns2__getDataTypeDef(), soap_in_ns2__getDataTypeDefResponse(), soap_in_ns2__getDataTypePattern(), soap_in_ns2__getDataTypePatternResponse(), soap_in_ns2__getDataTypesId(), soap_in_ns2__getDataTypesIdResponse(), soap_in_ns2__getDataTypesName(), soap_in_ns2__getDataTypesNameResponse(), soap_in_ns2__getDataTypeSynonyms(), soap_in_ns2__getDataTypeSynonymsResponse(), soap_in_ns2__getDataTypeURI(), soap_in_ns2__getDataTypeURIResponse(), soap_in_ns2__getDataTypeURIs(), soap_in_ns2__getDataTypeURIsResponse(), soap_in_ns2__getJavaLibraryVersion(), soap_in_ns2__getJavaLibraryVersionResponse(), soap_in_ns2__getLocation(), soap_in_ns2__getLocationResponse(), soap_in_ns2__getLocations(), soap_in_ns2__getLocations_(), soap_in_ns2__getLocationsResponse(), soap_in_ns2__getLocationsResponse_(), soap_in_ns2__getMiriamURI(), soap_in_ns2__getMiriamURIResponse(), soap_in_ns2__getName(), soap_in_ns2__getNameResponse(), soap_in_ns2__getNames(), soap_in_ns2__getNamesResponse(), soap_in_ns2__getOfficialDataTypeURI(), soap_in_ns2__getOfficialDataTypeURIResponse(), soap_in_ns2__getResourceInfo(), soap_in_ns2__getResourceInfoResponse(), soap_in_ns2__getResourceInstitution(), soap_in_ns2__getResourceInstitutionResponse(), soap_in_ns2__getResourceLocation(), soap_in_ns2__getResourceLocationResponse(), soap_in_ns2__getServicesInfo(), soap_in_ns2__getServicesInfoResponse(), soap_in_ns2__getServicesVersion(), soap_in_ns2__getServicesVersionResponse(), soap_in_ns2__getURI(), soap_in_ns2__getURIResponse(), soap_in_ns2__isDeprecated(), soap_in_ns2__isDeprecatedResponse(), soap_in_SOAP_ENV__Code(), soap_in_SOAP_ENV__Detail(), soap_in_SOAP_ENV__Fault(), soap_in_SOAP_ENV__Header(), soap_in_SOAP_ENV__Reason(), soap_inliteral(), soap_instring(), soap_inwliteral(), soap_inwstring(), soap_peek_element(), and soap_set_fault().

#define SOAP_NONE   0

Definition at line 1146 of file stdsoap2.h.

Referenced by soap_done().

#define SOAP_NULL   23

Definition at line 1018 of file stdsoap2.h.

Referenced by soap_element_begin_in(), and soap_set_fault().

#define SOAP_OCCURS   44
#define SOAP_OK   0

Definition at line 995 of file stdsoap2.h.

Referenced by fsend(), http_parse(), http_parse_header(), http_post(), http_send_header(), soap_accept(), soap_append_lab(), soap_attribute(), soap_begin(), soap_begin_count(), soap_begin_recv(), soap_begin_send(), soap_body_begin_in(), soap_body_end_in(), soap_body_end_out(), soap_connect_command(), soap_copy_context(), soap_dime_forward(), soap_element(), soap_element_begin_in(), soap_element_begin_out(), soap_element_end_in(), soap_element_end_out(), soap_element_href(), soap_element_null(), soap_element_result(), soap_element_start_end_out(), soap_end_count(), soap_end_recv(), soap_end_send(), soap_envelope_begin_in(), soap_envelope_end_out(), soap_fdelete(), soap_flush(), soap_flush_raw(), soap_getattrval(), soap_getdime(), soap_getdimehdr(), soap_getindependent(), soap_getline(), soap_getmimehdr(), soap_has_copies(), soap_ignore_element(), soap_in_ArrayOf_USCORExsd_USCOREstring(), soap_inliteral(), soap_instring(), soap_inwliteral(), soap_inwstring(), soap_isnumeric(), soap_match_array(), soap_match_namespace(), soap_match_tag(), soap_move(), soap_out_std__string(), soap_outliteral(), soap_outstring(), soap_outwliteral(), soap_outwstring(), soap_peek_element(), soap_poll(), soap_push_namespace(), soap_putbase64(), soap_putdime(), soap_putdimehdr(), soap_putelement(), soap_putfault(), soap_putheader(), soap_puthex(), soap_puthttphdr(), soap_putindependent(), soap_putmime(), soap_recv(), soap_recv_empty_response(), soap_recv_fault(), soap_recv_header(), soap_recv_raw(), soap_register_plugin_arg(), soap_resolve(), soap_response(), soap_retry(), soap_s2wchar(), soap_send(), soap_send_empty_response(), soap_send_fault(), soap_send_raw(), soap_set_attr(), soap_set_dime_attachment(), soap_set_mime_attachment(), soap_set_namespaces(), soap_string_out(), soap_try_connect_command(), soap_valid_mime_boundary(), soap_wstring_out(), soap_xop_forward(), tcp_disconnect(), tcp_gethost(), and CMIRIAMResources::updateMIRIAMResources().

#define soap_omode (   soap,
 
)    ((soap)->mode = (soap)->omode = (n))
#define SOAP_PLUGIN_ERROR   40

Definition at line 1035 of file stdsoap2.h.

Referenced by soap_set_fault().

#define SOAP_POST   2000

Definition at line 1063 of file stdsoap2.h.

Referenced by soap_connect(), soap_end_send(), and soap_try_connect_command().

#define SOAP_PROHIBITED   43

Definition at line 1038 of file stdsoap2.h.

Referenced by soap_attr_value(), and soap_set_fault().

#define SOAP_PTRBLK   (32) /* block allocation for pointer hash table chains */

Definition at line 823 of file stdsoap2.h.

Referenced by soap_pointer_enter().

#define SOAP_PTRHASH   (1024) /* size of pointer analysis hash table (must be power of 2) */

Definition at line 827 of file stdsoap2.h.

Referenced by soap_free_pht(), soap_init_pht(), and soap_putindependent().

#define SOAP_PUT_METHOD   16

Definition at line 1011 of file stdsoap2.h.

Referenced by http_put(), and soap_set_fault().

#define soap_random   rand()

Definition at line 1936 of file stdsoap2.h.

Referenced by fsend(), and soap_select_mime_boundary().

#define soap_register_plugin (   soap,
  plugin 
)    soap_register_plugin_arg(soap, plugin, NULL)

Definition at line 1901 of file stdsoap2.h.

#define SOAP_REQUIRED   42

Definition at line 1037 of file stdsoap2.h.

Referenced by soap_attr_value(), and soap_set_fault().

#define soap_reset_errno   (errno = 0)
#define soap_revget1 (   soap)    ((soap)->bufidx--)

Definition at line 1899 of file stdsoap2.h.

Referenced by soap_begin_recv(), soap_get(), and soap_getutf8().

#define soap_set_imode (   soap,
 
)    ((soap)->imode |= (n))

Definition at line 1903 of file stdsoap2.h.

#define soap_set_mode (   soap,
 
)    ((soap)->imode |= (n), (soap)->omode |= (n))

Definition at line 1908 of file stdsoap2.h.

#define soap_set_omode (   soap,
 
)    ((soap)->omode |= (n))

Definition at line 1906 of file stdsoap2.h.

#define soap_soap_error_check (   e)    ((e) == SOAP_CLI_FAULT || (e) == SOAP_SVR_FAULT || (e) == SOAP_VERSIONMISMATCH || (e) == SOAP_MUSTUNDERSTAND || (e) == SOAP_FAULT || (e) == SOAP_NO_METHOD)

Definition at line 1044 of file stdsoap2.h.

#define SOAP_SOCKET   int

Definition at line 692 of file stdsoap2.h.

Referenced by tcp_accept(), and tcp_connect().

#define soap_socket_errno (   s)    errno

Definition at line 803 of file stdsoap2.h.

Referenced by frecv(), fsend(), soap_accept(), soap_bind(), soap_poll(), tcp_connect(), and tcp_disconnect().

#define SOAP_SOCKLEN_T   size_t

Definition at line 684 of file stdsoap2.h.

Referenced by frecv(), tcp_accept(), and tcp_connect().

#define SOAP_SOURCE_STAMP (   str)

Definition at line 122 of file stdsoap2.h.

#define SOAP_SSL_ALLOW_EXPIRED_CERTIFICATE   0x08 /* client does not check the expiration date of the host certificate */

Definition at line 1135 of file stdsoap2.h.

#define SOAP_SSL_DEFAULT   (SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION | SOAP_SSLv3_TLSv1)

Definition at line 1142 of file stdsoap2.h.

Referenced by soap_init().

#define SOAP_SSL_ERROR   30

Definition at line 1025 of file stdsoap2.h.

Referenced by soap_closesock(), soap_set_fault(), tcp_connect(), and tcp_disconnect().

#define soap_ssl_error_check (   e)    ((e) == SOAP_SSL_ERROR)

Definition at line 1046 of file stdsoap2.h.

#define SOAP_SSL_NO_AUTHENTICATION   0x00 /* for testing purposes */

Definition at line 1131 of file stdsoap2.h.

#define SOAP_SSL_NO_DEFAULT_CA_PATH   0x10 /* don't use default_verify_paths */

Definition at line 1136 of file stdsoap2.h.

#define SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION   0x02 /* server requires client to authenticate */

Definition at line 1133 of file stdsoap2.h.

#define SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION   0x01 /* client requires server to authenticate */

Definition at line 1132 of file stdsoap2.h.

Referenced by tcp_connect().

#define SOAP_SSL_RSA   0x20 /* use RSA */

Definition at line 1137 of file stdsoap2.h.

#define SOAP_SSL_SKIP_HOST_CHECK   0x04 /* client does not check the common name of the host in certificate */

Definition at line 1134 of file stdsoap2.h.

Referenced by tcp_connect().

#define SOAP_SSLv3   0x40 /* SSL v3 only */

Definition at line 1138 of file stdsoap2.h.

#define SOAP_SSLv3_TLSv1   0x00 /* SSL v3 and TLS v1 support by default */

Definition at line 1140 of file stdsoap2.h.

#define SOAP_STD_API

Definition at line 1594 of file stdsoap2.h.

#define SOAP_STOP   1000 /* No HTTP response */
#define SOAP_STRCMP   strcmp /* case sensitive XML element/attribute names */

Definition at line 650 of file stdsoap2.h.

Referenced by soap_match_tag(), and soap_peek_element().

#define soap_strrchr (   s,
 
)    strrchr(s, t)

Definition at line 1913 of file stdsoap2.h.

Referenced by soap_array_begin_out(), and soap_peek_element().

#define soap_strtol (   s,
  t,
 
)    strtol(s, t, b)

Definition at line 1919 of file stdsoap2.h.

Referenced by soap_char(), soap_getsize(), soap_s2byte(), soap_s2int(), soap_s2long(), and soap_s2short().

#define soap_strtoul (   s,
  t,
 
)    strtoul(s, t, b)
#define SOAP_SVR_FAULT   2

Definition at line 997 of file stdsoap2.h.

Referenced by soap_recv_fault(), and soap_set_fault().

#define SOAP_SYNTAX_ERROR   5
#define SOAP_TAG_MISMATCH   3

Definition at line 998 of file stdsoap2.h.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), soap_element_begin_in(), soap_envelope_begin_in(), soap_getelement(), soap_ignore_element(), soap_in_ns2__checkRegExp(), soap_in_ns2__checkRegExpResponse(), soap_in_ns2__getDataResources(), soap_in_ns2__getDataResourcesResponse(), soap_in_ns2__getDataTypeDef(), soap_in_ns2__getDataTypeDefResponse(), soap_in_ns2__getDataTypePattern(), soap_in_ns2__getDataTypePatternResponse(), soap_in_ns2__getDataTypesId(), soap_in_ns2__getDataTypesIdResponse(), soap_in_ns2__getDataTypesName(), soap_in_ns2__getDataTypesNameResponse(), soap_in_ns2__getDataTypeSynonyms(), soap_in_ns2__getDataTypeSynonymsResponse(), soap_in_ns2__getDataTypeURI(), soap_in_ns2__getDataTypeURIResponse(), soap_in_ns2__getDataTypeURIs(), soap_in_ns2__getDataTypeURIsResponse(), soap_in_ns2__getJavaLibraryVersion(), soap_in_ns2__getJavaLibraryVersionResponse(), soap_in_ns2__getLocation(), soap_in_ns2__getLocationResponse(), soap_in_ns2__getLocations(), soap_in_ns2__getLocations_(), soap_in_ns2__getLocationsResponse(), soap_in_ns2__getLocationsResponse_(), soap_in_ns2__getMiriamURI(), soap_in_ns2__getMiriamURIResponse(), soap_in_ns2__getName(), soap_in_ns2__getNameResponse(), soap_in_ns2__getNames(), soap_in_ns2__getNamesResponse(), soap_in_ns2__getOfficialDataTypeURI(), soap_in_ns2__getOfficialDataTypeURIResponse(), soap_in_ns2__getResourceInfo(), soap_in_ns2__getResourceInfoResponse(), soap_in_ns2__getResourceInstitution(), soap_in_ns2__getResourceInstitutionResponse(), soap_in_ns2__getResourceLocation(), soap_in_ns2__getResourceLocationResponse(), soap_in_ns2__getServicesInfo(), soap_in_ns2__getServicesInfoResponse(), soap_in_ns2__getServicesVersion(), soap_in_ns2__getServicesVersionResponse(), soap_in_ns2__getURI(), soap_in_ns2__getURIResponse(), soap_in_ns2__isDeprecated(), soap_in_ns2__isDeprecatedResponse(), soap_in_SOAP_ENV__Code(), soap_in_SOAP_ENV__Detail(), soap_in_SOAP_ENV__Fault(), soap_in_SOAP_ENV__Header(), soap_in_SOAP_ENV__Reason(), soap_match_array(), soap_match_tag(), soap_recv_header(), and soap_set_fault().

#define SOAP_TAGLEN   (1024) /* maximum length of XML element tag/attribute name or host/path name + 1 */

Definition at line 848 of file stdsoap2.h.

#define SOAP_TCP_ERROR   28
#define soap_tcp_error_check (   e)    ((e) == SOAP_EOF || (e) == SOAP_TCP_ERROR)

Definition at line 1045 of file stdsoap2.h.

#define SOAP_TLSv1   0x80 /* TLS v1 only */

Definition at line 1139 of file stdsoap2.h.

#define SOAP_TYPE   4
#define SOAP_UDP_ERROR   27

Definition at line 1022 of file stdsoap2.h.

Referenced by soap_begin_send(), and soap_set_fault().

#define SOAP_ULONG_FORMAT   "%llu" /* printf format for unsigned 64 bit ints */

Definition at line 750 of file stdsoap2.h.

Referenced by soap_s2ULONG64(), and soap_ULONG642s().

#define soap_unget (   soap,
 
)    ((soap)->ahead = c)
#define SOAP_USER_ERROR   10

Definition at line 1005 of file stdsoap2.h.

Referenced by soap_set_fault().

#define soap_valid_socket (   n)    ((n) != SOAP_INVALID_SOCKET)
#define SOAP_VERSIONMISMATCH   39

Definition at line 1034 of file stdsoap2.h.

Referenced by soap_envelope_begin_in(), soap_recv_fault(), and soap_set_fault().

#define SOAP_WINSOCKINT   size_t

Definition at line 587 of file stdsoap2.h.

Referenced by frecv(), and fsend().

#define SOAP_XML_CANONICAL   0x00004000 /* EXC C14N canonical XML */
#define SOAP_XML_DOM   0x00040000
#define soap_xml_error_check (   e)    ((e) == SOAP_TAG_MISMATCH || (e) == SOAP_NO_TAG || (e) == SOAP_SYNTAX_ERROR || (e) == SOAP_NAMESPACE || (e) == SOAP_DUPLICATE_ID || (e) == SOAP_MISSING_ID || (e) == SOAP_REQUIRED || (e) == SOAP_PROHIBITED || (e) == SOAP_OCCURS || (e) == SOAP_LENGTH || (e) == SOAP_NULL || (e) == SOAP_HREF)

Definition at line 1043 of file stdsoap2.h.

#define SOAP_XML_GRAPH   0x00010000
#define SOAP_XML_INDENT   0x00002000 /* emit indented XML */

Definition at line 1108 of file stdsoap2.h.

Referenced by soap_element(), and soap_element_end_out().

#define SOAP_XML_NIL   0x00020000

Definition at line 1112 of file stdsoap2.h.

Referenced by soap_element_null().

#define SOAP_XML_SEC   0x00080000 /* reserved for WS security */

Definition at line 1114 of file stdsoap2.h.

Referenced by soap_body_begin_out(), soap_element(), and soap_end_send().

#define SOAP_XML_STRICT   0x00001000 /* apply strict validation */

Definition at line 1107 of file stdsoap2.h.

Referenced by soap_attr_value(), soap_element_begin_in(), soap_element_end_in(), soap_ignore_element(), soap_in_ns2__checkRegExp(), soap_in_ns2__checkRegExpResponse(), soap_in_ns2__getDataResources(), soap_in_ns2__getDataTypeDef(), soap_in_ns2__getDataTypeDefResponse(), soap_in_ns2__getDataTypePattern(), soap_in_ns2__getDataTypePatternResponse(), soap_in_ns2__getDataTypeSynonyms(), soap_in_ns2__getDataTypeURI(), soap_in_ns2__getDataTypeURIResponse(), soap_in_ns2__getDataTypeURIs(), soap_in_ns2__getJavaLibraryVersionResponse(), soap_in_ns2__getLocation(), soap_in_ns2__getLocationResponse(), soap_in_ns2__getLocations(), soap_in_ns2__getLocations_(), soap_in_ns2__getMiriamURI(), soap_in_ns2__getMiriamURIResponse(), soap_in_ns2__getName(), soap_in_ns2__getNameResponse(), soap_in_ns2__getNames(), soap_in_ns2__getOfficialDataTypeURI(), soap_in_ns2__getOfficialDataTypeURIResponse(), soap_in_ns2__getResourceInfo(), soap_in_ns2__getResourceInfoResponse(), soap_in_ns2__getResourceInstitution(), soap_in_ns2__getResourceInstitutionResponse(), soap_in_ns2__getResourceLocation(), soap_in_ns2__getResourceLocationResponse(), soap_in_ns2__getServicesInfoResponse(), soap_in_ns2__getServicesVersionResponse(), soap_in_ns2__getURI(), soap_in_ns2__getURIResponse(), soap_in_ns2__isDeprecated(), soap_in_ns2__isDeprecatedResponse(), soap_s2int(), soap_s2long(), soap_s2LONG64(), soap_s2ULONG64(), soap_s2unsignedInt(), soap_s2unsignedLong(), soap_string_in(), and soap_wstring_in().

#define SOAP_XML_TREE   0x00008000 /* emit XML tree (no id/ref) */
#define SOAP_ZLIB_DEFLATE   0x01
#define SOAP_ZLIB_ERROR   31
#define soap_zlib_error_check (   e)    ((e) == SOAP_ZLIB_ERROR)

Definition at line 1047 of file stdsoap2.h.

#define SOAP_ZLIB_GZIP   0x02
#define SOAP_ZLIB_INFLATE   0x02

Definition at line 1079 of file stdsoap2.h.

Referenced by soap_begin_recv(), and soap_closesock().

#define SOAP_ZLIB_NONE   0x00
#define STDSOAP_H

Definition at line 143 of file stdsoap2.h.

#define ULONG64   unsigned LONG64

Definition at line 734 of file stdsoap2.h.

Referenced by soap_inULONG64().

#define WITH_FAST

Definition at line 127 of file stdsoap2.h.

Typedef Documentation

typedef int32_t soap_mode

Definition at line 1084 of file stdsoap2.h.

typedef int32_t soap_wchar

Definition at line 1257 of file stdsoap2.h.

Enumeration Type Documentation

Enumerator
SOAP_MIME_NONE 
SOAP_MIME_7BIT 
SOAP_MIME_8BIT 
SOAP_MIME_BINARY 
SOAP_MIME_QUOTED_PRINTABLE 
SOAP_MIME_BASE64 
SOAP_MIME_IETF_TOKEN 
SOAP_MIME_X_TOKEN 

Definition at line 1425 of file stdsoap2.h.

Function Documentation

int soap_accept ( struct soap )

Definition at line 5779 of file stdsoap2.cpp.

References soap::accept_flags, soap::accept_timeout, DBGLOG, soap::errmode, soap::errnum, soap::error, soap::faccept, soap::host, soap::imode, soap::ip, soap::keep_alive, soap::linger_time, soap::master, soap::omode, soap::peer, soap::peerlen, soap::port, soap::recv_timeout, soap::send_timeout, SOAP_BUFLEN, soap_closesock(), SOAP_EAGAIN, SOAP_EINTR, SOAP_EWOULDBLOCK, SOAP_FD_EXCEEDED, SOAP_INVALID_SOCKET, SOAP_IO_KEEPALIVE, SOAP_IO_UDP, SOAP_OK, soap_set_receiver_error(), soap_set_sender_error(), SOAP_SOCKBLOCK, soap_socket_errno, SOAP_SOCKNONBLOCK, SOAP_TCP_ERROR, soap_valid_socket, soap::socket, and tcp_error().

5780  {
5781  int n = (int)sizeof(soap->peer);
5782 #ifndef WITH_LEAN
5783  int len = SOAP_BUFLEN;
5784  int set = 1;
5785 #endif
5786  soap->error = SOAP_OK;
5787 #ifndef WITH_LEAN
5788 
5789  if ((soap->omode & SOAP_IO_UDP))
5790  return soap->socket = soap->master;
5791 
5792 #endif
5793  memset((void*)&soap->peer, 0, sizeof(soap->peer));
5795  soap->errmode = 0;
5796  soap->keep_alive = 0;
5797 
5799  {
5800  register int err;
5801 
5802  for (;;)
5803  {
5804 #ifndef WITH_LEAN
5805 
5807  {
5808 #ifndef WIN32
5809 
5810  if ((int)soap->socket >= (int)FD_SETSIZE)
5811  {
5813  return SOAP_INVALID_SOCKET; /* Hint: MUST increase FD_SETSIZE */
5814  }
5815 
5816 #endif
5817 
5818  for (;;)
5819  {
5820  struct timeval timeout;
5821  fd_set fd;
5822  register int r;
5823 
5824  if (soap->accept_timeout > 0)
5825  {
5826  timeout.tv_sec = soap->accept_timeout;
5827  timeout.tv_usec = 0;
5828  }
5829  else if (soap->accept_timeout < 0)
5830  {
5831  timeout.tv_sec = -soap->accept_timeout / 1000000;
5832  timeout.tv_usec = -soap->accept_timeout % 1000000;
5833  }
5834  else
5835  {
5836  timeout.tv_sec = 60;
5837  timeout.tv_usec = 0;
5838  }
5839 
5840  FD_ZERO(&fd);
5841  FD_SET(soap->master, &fd);
5842  r = select((int)soap->master + 1, &fd, &fd, &fd, &timeout);
5843 
5844  if (r > 0)
5845  break;
5846 
5847  if (!r && soap->accept_timeout)
5848  {
5849  soap->errnum = 0;
5850  soap_set_receiver_error(soap, "Timeout", "accept failed in soap_accept()", SOAP_TCP_ERROR);
5851  return SOAP_INVALID_SOCKET;
5852  }
5853 
5854  if (r < 0)
5855  {
5857 
5858  if (r != SOAP_EINTR)
5859  {
5860  soap->errnum = r;
5862  soap_set_sender_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
5863  return SOAP_INVALID_SOCKET;
5864  }
5865  }
5866  }
5867  }
5868 
5871  else
5872  SOAP_SOCKBLOCK(soap->master)
5873 #endif
5874  soap->socket = soap->faccept(soap, soap->master, (struct sockaddr*) & soap->peer, &n);
5875 
5876  soap->peerlen = (size_t)n;
5877 
5879  {
5880 #ifdef WITH_IPV6
5881  /* Use soap->host to store the numeric form of the remote host */
5882  getnameinfo((struct sockaddr*)&soap->peer, n, soap->host, sizeof(soap->host), NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV);
5883  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Accept socket %d from %s\n", soap->socket, soap->host));
5884  soap->ip = 0; /* info stored in soap->peer and soap->host */
5885  soap->port = 0; /* info stored in soap->peer and soap->host */
5886 #else
5887  soap->ip = ntohl(soap->peer.sin_addr.s_addr);
5888  soap->port = (int)ntohs(soap->peer.sin_port); /* does not return port number on some systems */
5889  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Accept socket %d at port %d from IP %d.%d.%d.%d\n", soap->socket, soap->port, (int)(soap->ip >> 24)&0xFF, (int)(soap->ip >> 16)&0xFF, (int)(soap->ip >> 8)&0xFF, (int)soap->ip&0xFF));
5890 #endif
5891 #ifndef WITH_LEAN
5892 
5893  if (soap->accept_flags == SO_LINGER)
5894  {
5895  struct linger linger;
5896  memset((void*)&linger, 0, sizeof(linger));
5897  linger.l_onoff = 1;
5898  linger.l_linger = soap->linger_time;
5899 
5900  if (setsockopt(soap->socket, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))
5901  {
5903  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_LINGER failed in soap_accept()", SOAP_TCP_ERROR);
5905  return SOAP_INVALID_SOCKET;
5906  }
5907  }
5908  else if (soap->accept_flags && setsockopt(soap->socket, SOL_SOCKET, soap->accept_flags, (char*)&set, sizeof(int)))
5909  {
5911  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_accept()", SOAP_TCP_ERROR);
5913  return SOAP_INVALID_SOCKET;
5914  }
5915 
5916  if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && setsockopt(soap->socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
5917  {
5919  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR);
5921  return SOAP_INVALID_SOCKET;
5922  }
5923 
5924  if (setsockopt(soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
5925  {
5927  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_accept()", SOAP_TCP_ERROR);
5929  return SOAP_INVALID_SOCKET;
5930  }
5931 
5932  if (setsockopt(soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
5933  {
5935  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_accept()", SOAP_TCP_ERROR);
5937  return SOAP_INVALID_SOCKET;
5938  }
5939 
5940 #ifdef TCP_NODELAY
5941 
5942  if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->socket, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
5943  {
5945  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_accept()", SOAP_TCP_ERROR);
5947  return SOAP_INVALID_SOCKET;
5948  }
5949 
5950 #endif
5951 #endif
5952  soap->keep_alive = (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0);
5953  return soap->socket;
5954  }
5955 
5956  err = soap_socket_errno(soap->socket);
5957 
5958  if (err != 0 && err != SOAP_EINTR && err != SOAP_EAGAIN && err != SOAP_EWOULDBLOCK)
5959  {
5960  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Accept failed from %s\n", soap->host));
5961  soap->errnum = err;
5962  soap_set_receiver_error(soap, tcp_error(soap), "accept failed in soap_accept()", SOAP_TCP_ERROR);
5964  return SOAP_INVALID_SOCKET;
5965  }
5966  }
5967  }
5968  else
5969  {
5970  soap->errnum = 0;
5971  soap_set_receiver_error(soap, tcp_error(soap), "no master socket in soap_accept()", SOAP_TCP_ERROR);
5972  return SOAP_INVALID_SOCKET;
5973  }
5974  }
#define soap_socket_errno(s)
Definition: stdsoap2.h:803
short keep_alive
Definition: stdsoap2.h:1742
int error
Definition: stdsoap2.h:1755
#define SOAP_SOCKNONBLOCK(fd)
Definition: stdsoap2.cpp:274
unsigned long ip
Definition: stdsoap2.h:1740
#define soap_valid_socket(n)
Definition: stdsoap2.h:698
int(* faccept)(struct soap *, int, struct sockaddr *, int *n)
Definition: stdsoap2.h:1655
soap_mode imode
Definition: stdsoap2.h:1602
#define SOAP_EWOULDBLOCK
Definition: stdsoap2.h:785
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
#define FD_SETSIZE
Definition: stdsoap2.h:705
#define SOAP_IO_UDP
Definition: stdsoap2.h:1092
int accept_timeout
Definition: stdsoap2.h:1615
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_EAGAIN
Definition: stdsoap2.h:779
int errmode
Definition: stdsoap2.h:1756
int soap_set_receiver_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
Definition: stdsoap2.cpp:19218
int master
Definition: stdsoap2.h:1683
soap_mode omode
Definition: stdsoap2.h:1603
int send_timeout
Definition: stdsoap2.h:1613
size_t peerlen
Definition: stdsoap2.h:1787
int soap_set_sender_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
Definition: stdsoap2.cpp:19207
static const char * tcp_error(struct soap *)
Definition: stdsoap2.cpp:4506
#define SOAP_SOCKBLOCK(fd)
Definition: stdsoap2.cpp:273
struct sockaddr_in peer
Definition: stdsoap2.h:1784
int errnum
Definition: stdsoap2.h:1757
char host[(1024)]
Definition: stdsoap2.h:1736
int recv_timeout
Definition: stdsoap2.h:1612
int port
Definition: stdsoap2.h:1741
int soap_closesock(struct soap *soap)
Definition: stdsoap2.cpp:6121
#define SOAP_INVALID_SOCKET
Definition: stdsoap2.h:697
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_TCP_ERROR
Definition: stdsoap2.h:1023
unsigned short linger_time
Definition: stdsoap2.h:1620
int socket
Definition: stdsoap2.h:1684
#define SOAP_IO_KEEPALIVE
Definition: stdsoap2.h:1095
#define SOAP_FD_EXCEEDED
Definition: stdsoap2.h:1041
int accept_flags
Definition: stdsoap2.h:1619
#define SOAP_EINTR
Definition: stdsoap2.h:778
int soap_append_lab ( struct soap ,
const char *  ,
size_t   
)

Definition at line 10289 of file stdsoap2.cpp.

References DBGLOG, soap::error, soap::labbuf, soap::labidx, soap::lablen, SOAP_EOM, SOAP_FREE, SOAP_LABLEN, SOAP_MALLOC, and SOAP_OK.

Referenced by soap_get_http_body(), soap_getbase64(), soap_gethex(), soap_peek_element(), soap_QName2s(), soap_s2QName(), soap_store_lab(), and soap_string_in().

10290  {
10291  if (soap->labidx + n >= soap->lablen)
10292  {
10293  register char *t = soap->labbuf;
10294  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enlarging look-aside buffer to append data, old size=%lu", (unsigned long)soap->lablen));
10295 
10296  if (soap->lablen == 0)
10297  soap->lablen = SOAP_LABLEN;
10298 
10299  while (soap->labidx + n >= soap->lablen)
10300  soap->lablen <<= 1;
10301 
10302  DBGLOG(TEST, SOAP_MESSAGE(fdebug, ", new size=%lu\n", (unsigned long)soap->lablen));
10303  soap->labbuf = (char*)SOAP_MALLOC(soap, soap->lablen);
10304 
10305  if (!soap->labbuf)
10306  {
10307  if (t)
10308  SOAP_FREE(soap, t);
10309 
10310  return soap->error = SOAP_EOM;
10311  }
10312 
10313  if (t)
10314  {
10315  memcpy(soap->labbuf, t, soap->labidx);
10316  SOAP_FREE(soap, t);
10317  }
10318  }
10319 
10320  if (s)
10321  {
10322  memcpy(soap->labbuf + soap->labidx, s, n);
10323  soap->labidx += n;
10324  }
10325 
10326  return SOAP_OK;
10327  }
size_t lablen
Definition: stdsoap2.h:1708
#define SOAP_LABLEN
Definition: stdsoap2.h:820
int error
Definition: stdsoap2.h:1755
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
size_t labidx
Definition: stdsoap2.h:1709
char * labbuf
Definition: stdsoap2.h:1707
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_EOM
Definition: stdsoap2.h:1015
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
int soap_array_begin_out ( struct soap ,
const char *  tag,
int  id,
const char *  type,
const char *  offset 
)

Definition at line 9404 of file stdsoap2.cpp.

References soap::error, soap::mode, soap_attribute(), soap_element(), soap_element_begin_out(), soap_element_start_end_out(), soap_strrchr, soap_utilize_ns(), SOAP_XML_CANONICAL, soap::tmpbuf, and soap::version.

Referenced by soap_out_ArrayOf_USCORExsd_USCOREstring().

9405  {
9406  if (!type || !*type)
9407  return soap_element_begin_out(soap, tag, id, NULL);
9408 
9409  if (soap_element(soap, tag, id, "SOAP-ENC:Array"))
9410  return soap->error;
9411 
9412  if (soap->version == 2)
9413  {
9414  const char *s;
9415  s = soap_strrchr(type, '[');
9416 
9417  if ((size_t)(s - type) < sizeof(soap->tmpbuf))
9418  {
9419  strncpy(soap->tmpbuf, type, s - type);
9420  soap->tmpbuf[s - type] = '\0';
9421 
9422  if (soap_attribute(soap, "SOAP-ENC:itemType", soap->tmpbuf))
9423  return soap->error;
9424 
9425  if (s && (soap_attribute(soap, "SOAP-ENC:arraySize", s + 1)))
9426  return soap->error;
9427  }
9428  }
9429  else
9430  {
9431  if (offset && soap_attribute(soap, "SOAP-ENC:offset", offset))
9432  return soap->error;
9433 
9434  if (soap_attribute(soap, "SOAP-ENC:arrayType", type))
9435  return soap->error;
9436  }
9437 
9438 #ifndef WITH_LEAN
9439 
9440  if ((soap->mode & SOAP_XML_CANONICAL))
9441  {
9442  const char *s = strchr(type, ':');
9443 
9444  if (s)
9445  soap_utilize_ns(soap, type, s - type);
9446  }
9447 
9448 #endif
9449  return soap_element_start_end_out(soap, NULL);
9450  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
int soap_element(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9009
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
short version
Definition: stdsoap2.h:1600
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
int soap_element_start_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9458
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
#define soap_strrchr(s, t)
Definition: stdsoap2.h:1913
static void soap_utilize_ns(struct soap *soap, const char *tag, size_t n)
Definition: stdsoap2.cpp:8976
int soap_attribute(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:9802
int soap_array_pointer_lookup ( struct soap ,
const void p,
const struct soap_array a,
int  n,
int  t,
struct soap_plist **   
)

Definition at line 6383 of file stdsoap2.cpp.

References soap_array::__ptr, soap_array::__size, soap_plist::array, DBGLOG, soap_plist::id, soap_plist::next, soap::pht, soap_hash_ptr, and soap_plist::type.

Referenced by soap_array_reference(), soap_attachment(), soap_element_id(), and soap_embed().

6384  {
6385  register struct soap_plist *pp;
6386  *ppp = NULL;
6387 
6388  if (!p || !a->__ptr)
6389  return 0;
6390 
6391  for (pp = soap->pht[soap_hash_ptr(a->__ptr)]; pp; pp = pp->next)
6392  {
6393  if (pp->type == type && pp->array && pp->array->__ptr == a->__ptr)
6394  {
6395  register int i;
6396 
6397  for (i = 0; i < n; i++)
6398  if (((const int*)&pp->array->__size)[i] != ((const int*)&a->__size)[i])
6399  break;
6400 
6401  if (i == n)
6402  {
6403  *ppp = pp;
6404  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d id=%d\n", a->__ptr, type, pp->id));
6405  return pp->id;
6406  }
6407  }
6408  }
6409 
6410  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d: not found\n", a->__ptr, type));
6411  return 0;
6412  }
struct soap_plist * next
Definition: stdsoap2.h:1296
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
const struct soap_array * array
Definition: stdsoap2.h:1298
int __size
Definition: stdsoap2.h:1290
struct soap_plist * pht[(1024)]
Definition: stdsoap2.h:1628
#define soap_hash_ptr(p)
Definition: stdsoap2.cpp:124
void * __ptr
Definition: stdsoap2.h:1289
int soap_array_reference ( struct soap ,
const void p,
const struct soap_array a,
int  n,
int  t 
)

Definition at line 6723 of file stdsoap2.cpp.

References soap_array::__ptr, DBGLOG, soap_plist::mark1, soap_plist::mark2, soap_array_pointer_lookup(), and soap_pointer_enter().

Referenced by ArrayOf_USCORExsd_USCOREstring::soap_serialize().

6724  {
6725  register int i;
6726  struct soap_plist *pp;
6727 
6728  if (!p || !a->__ptr)
6729  return 1;
6730 
6731  i = soap_array_pointer_lookup(soap, p, a, n, t, &pp);
6732 
6733  if (i)
6734  {
6735  if (pp->mark1 == 0)
6736  {
6737  pp->mark1 = 2;
6738  pp->mark2 = 2;
6739  }
6740  }
6741  else if (!soap_pointer_enter(soap, p, a, n, t, &pp))
6742  return 1;
6743  else
6744  {
6745  pp->mark1 = 0;
6746  pp->mark2 = 0;
6747  }
6748 
6749  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array reference %p ptr=%p dim=%d type=%d (%d %d)\n", p, a->__ptr, n, t, (int)pp->mark1, (int)pp->mark2));
6750  return pp->mark1;
6751  }
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char mark1
Definition: stdsoap2.h:1301
int soap_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6336
int soap_array_pointer_lookup(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6383
void * __ptr
Definition: stdsoap2.h:1289
char mark2
Definition: stdsoap2.h:1302
int soap_attachment ( struct soap ,
const char *  ,
int  ,
const void ,
const struct soap_array ,
const char *  ,
const char *  ,
const char *  ,
int  ,
const char *  ,
int   
)

Definition at line 6888 of file stdsoap2.cpp.

References soap_array::__ptr, soap_array::__size, DBGLOG, soap::dime, soap::dime_id_format, soap_multipart::encoding, soap::error, soap_dime::first, soap_mime::first, soap_multipart::id, soap_dime::last, soap_mime::last, soap_plist::mark1, soap_plist::mark2, soap::mime, soap::mode, soap_multipart::options, soap_array_pointer_lookup(), soap_element_begin_out(), soap_element_end_out(), soap_element_href(), soap_element_id(), SOAP_ENC_MTOM, SOAP_EOM, SOAP_IO_LENGTH, soap_malloc(), SOAP_MIME_BINARY, soap_new_multipart(), soap_pointer_enter(), SOAP_STR_EOS, soap_strdup(), soap::tmpbuf, and soap_multipart::type.

6889  {
6890 #ifndef WITH_NOIDREF
6891  struct soap_plist *pp;
6892  int i;
6893 
6894  if (!p || !a->__ptr || (!aid && !atype))
6895  return soap_element_id(soap, tag, id, p, a, n, type, t);
6896 
6897  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attachment tag='%s' id='%s' (%d) type='%s'\n", tag, aid ? aid : SOAP_STR_EOS, id, atype ? atype : SOAP_STR_EOS));
6898  i = soap_array_pointer_lookup(soap, p, a, n, t, &pp);
6899 
6900  if (!i)
6901  {
6902  i = soap_pointer_enter(soap, p, a, n, t, &pp);
6903 
6904  if (!i)
6905  {
6906  soap->error = SOAP_EOM;
6907  return - 1;
6908  }
6909  }
6910 
6911  if (id <= 0)
6912  id = i;
6913 
6914  if (!aid)
6915  {
6916  sprintf(soap->tmpbuf, soap->dime_id_format, id);
6917  aid = soap_strdup(soap, soap->tmpbuf);
6918  }
6919 
6920  /* Add MTOM xop:Include element when necessary */
6921 
6922  /* TODO: this code to be obsoleted with new import/xop.h conventions */
6923  if ((soap->mode & SOAP_ENC_MTOM) && strcmp(tag, "xop:Include"))
6924  {
6925  if (soap_element_begin_out(soap, tag, 0, type)
6926  || soap_element_href(soap, "xop:Include", 0, "href", aid)
6927  || soap_element_end_out(soap, tag))
6928  return soap->error;
6929  }
6930  else if (soap_element_href(soap, tag, 0, "href", aid))
6931  return soap->error;
6932 
6933  if (soap->mode & SOAP_IO_LENGTH)
6934  {
6935  if (pp->mark1 != 3)
6936  {
6937  struct soap_multipart *content;
6938 
6939  if (soap->mode & SOAP_ENC_MTOM)
6940  content = soap_new_multipart(soap, &soap->mime.first, &soap->mime.last, (char*)a->__ptr, a->__size);
6941  else
6942  content = soap_new_multipart(soap, &soap->dime.first, &soap->dime.last, (char*)a->__ptr, a->__size);
6943 
6944  if (!content)
6945  {
6946  soap->error = SOAP_EOM;
6947  return - 1;
6948  }
6949 
6950  if (!strncmp(aid, "cid:", 4)) /* RFC 2111 */
6951  {
6952  if (soap->mode & SOAP_ENC_MTOM)
6953  {
6954  char *s = (char*)soap_malloc(soap, strlen(aid) - 1);
6955 
6956  if (s)
6957  {
6958  *s = '<';
6959  strcpy(s + 1, aid + 4);
6960  strcat(s, ">");
6961  content->id = s;
6962  }
6963  }
6964  else
6965  content->id = aid + 4;
6966  }
6967  else
6968  content->id = aid;
6969 
6970  content->type = atype;
6971  content->options = aoptions;
6972  content->encoding = SOAP_MIME_BINARY;
6973  pp->mark1 = 3;
6974  }
6975  }
6976  else
6977  pp->mark2 = 3;
6978 
6979 #endif
6980  return - 1;
6981  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
const char * id
Definition: stdsoap2.h:1444
const char * dime_id_format
Definition: stdsoap2.h:1606
int error
Definition: stdsoap2.h:1755
struct soap_multipart * first
Definition: stdsoap2.h:1413
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
soap_mode mode
Definition: stdsoap2.h:1601
struct soap_multipart * first
Definition: stdsoap2.h:1397
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1101
static struct soap_multipart * soap_new_multipart(struct soap *, struct soap_multipart **, struct soap_multipart **, char *, size_t)
Definition: stdsoap2.cpp:15487
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char mark1
Definition: stdsoap2.h:1301
enum soap_mime_encoding encoding
Definition: stdsoap2.h:1447
struct soap_dime dime
Definition: stdsoap2.h:1760
int soap_element_id(struct soap *soap, const char *tag, int id, const void *p, const struct soap_array *a, int n, const char *type, int t)
Definition: stdsoap2.cpp:9717
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
struct soap_multipart * last
Definition: stdsoap2.h:1397
struct soap_multipart * last
Definition: stdsoap2.h:1413
int soap_element_href(struct soap *soap, const char *tag, int id, const char *ref, const char *val)
Definition: stdsoap2.cpp:9668
int soap_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6336
int soap_array_pointer_lookup(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6383
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
#define SOAP_EOM
Definition: stdsoap2.h:1015
const char * options
Definition: stdsoap2.h:1446
struct soap_mime mime
Definition: stdsoap2.h:1761
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
char mark2
Definition: stdsoap2.h:1302
const char * type
Definition: stdsoap2.h:1445
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
const char* soap_attr_value ( struct soap soap,
const char *  name,
int  flag 
)

Definition at line 10003 of file stdsoap2.cpp.

References soap::attributes, soap::error, soap::mode, soap_attribute::name, soap_attribute::next, soap_match_tag(), SOAP_PROHIBITED, SOAP_REQUIRED, SOAP_STR_EOS, SOAP_XML_STRICT, soap_attribute::value, and soap_attribute::visible.

10004  {
10005  register struct soap_attribute *tp;
10006 
10007  if (*name == '-')
10008  return SOAP_STR_EOS;
10009 
10010  for (tp = soap->attributes; tp; tp = tp->next)
10011  {
10012  if (tp->visible && !soap_match_tag(soap, tp->name, name))
10013  break;
10014  }
10015 
10016  if (tp)
10017  {
10018  if (flag == 2 && (soap->mode & SOAP_XML_STRICT))
10019  soap->error = SOAP_PROHIBITED;
10020  else
10021  return tp->value;
10022  }
10023  else if (flag == 1 && (soap->mode & SOAP_XML_STRICT))
10024  soap->error = SOAP_REQUIRED;
10025 
10026  return NULL;
10027  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
struct soap_attribute * next
Definition: stdsoap2.h:1337
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
long int flag
Definition: f2c.h:52
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
char name[1]
Definition: stdsoap2.h:1342
#define SOAP_PROHIBITED
Definition: stdsoap2.h:1038
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
#define SOAP_REQUIRED
Definition: stdsoap2.h:1037
char * value
Definition: stdsoap2.h:1338
int soap_attribute ( struct soap ,
const char *  ,
const char *   
)

Definition at line 9802 of file stdsoap2.cpp.

References soap_dom_element::atts, soap_dom_attribute::data, DBGLOG, soap::dom, soap::error, soap::mode, soap_dom_attribute::name, soap_dom_attribute::next, soap_dom_attribute::nstr, soap_dom_attribute::soap, soap_malloc(), SOAP_OK, soap_push_ns(), soap_send(), soap_send_raw(), soap_set_attr(), soap_strdup(), soap_string_out(), SOAP_XML_CANONICAL, SOAP_XML_DOM, and soap_dom_attribute::wide.

Referenced by soap_array_begin_out(), soap_element(), soap_element_href(), soap_element_null(), soap_element_result(), soap_outliteral(), and soap_outwliteral().

9803  {
9804  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Attribute '%s'='%s'\n", name, value));
9805 #ifdef WITH_DOM
9806 
9807  if ((soap->mode & SOAP_XML_DOM) && !(soap->mode & SOAP_XML_CANONICAL) && soap->dom)
9808  {
9809  register struct soap_dom_attribute *a = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute));
9810 
9811  if (!a)
9812  return soap->error;
9813 
9814  a->next = soap->dom->atts;
9815  a->nstr = NULL;
9816  a->name = soap_strdup(soap, name);
9817  a->data = soap_strdup(soap, value);
9818  a->wide = NULL;
9819  a->soap = soap;
9820  soap->dom->atts = a;
9821  return SOAP_OK;
9822  }
9823 
9824 #endif
9825 #ifndef WITH_LEAN
9826 
9827  if (soap->mode & SOAP_XML_CANONICAL)
9828  {/* TODO: consider using this code to handle default namespace bindings
9829  if (!strncmp(name, "xmlns", 5) && (name[5] == ':' || name[5] == '\0'))
9830  {if (name[5] == ':')
9831  soap_push_ns(soap, name + 6, value, 0);
9832  else
9833  soap_push_ns(soap, "", value, 0);
9834  }
9835  */
9836  if (!strncmp(name, "xmlns:", 6))
9837  soap_push_ns(soap, name + 6, value, 0);
9838  else if (soap_set_attr(soap, name, value))
9839  return soap->error;
9840  }
9841  else
9842 #endif
9843 
9844  {
9845  if (soap_send(soap, " ") || soap_send(soap, name))
9846  return soap->error;
9847 
9848  if (value)
9849  if (soap_send_raw(soap, "=\"", 2)
9850  || soap_string_out(soap, value, 1)
9851  || soap_send_raw(soap, "\"", 1))
9852  return soap->error;
9853  }
9854 
9855  return SOAP_OK;
9856  }
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
const char * nstr
Definition: stdsoap2.h:1494
soap_mode mode
Definition: stdsoap2.h:1601
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
int soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:959
wchar_t * wide
Definition: stdsoap2.h:1497
static struct soap_nlist * soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized)
Definition: stdsoap2.cpp:8914
struct soap_dom_attribute * next
Definition: stdsoap2.h:1493
char name[1]
Definition: stdsoap2.h:1342
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_set_attr(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:10035
struct soap_dom_attribute * atts
Definition: stdsoap2.h:1541
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
char * value
Definition: stdsoap2.h:1338
struct soap * soap
Definition: stdsoap2.h:1498
const char* soap_base642s ( struct soap ,
const char *  ,
char *  ,
size_t  ,
int *   
)

Definition at line 18039 of file stdsoap2.cpp.

References soap::error, soap_blank, SOAP_BLKLEN, soap_malloc(), SOAP_NON_NULL, and SOAP_TYPE.

Referenced by http_parse_header(), and soap_getbase64().

18040  {
18041  register int i, j, c;
18042  register unsigned long m;
18043  register const char *p;
18044 
18045  if (!s || !*s)
18046  {
18047  if (n)
18048  *n = 0;
18049 
18050  if (soap->error)
18051  return NULL;
18052 
18053  return SOAP_NON_NULL;
18054  }
18055 
18056  if (!t)
18057  {
18058  l = (strlen(s) + 3) / 4 * 3;
18059  t = (char*)soap_malloc(soap, l);
18060  }
18061 
18062  if (!t)
18063  return NULL;
18064 
18065  p = t;
18066 
18067  if (n)
18068  *n = 0;
18069 
18070  for (;;)
18071  {
18072  for (i = 0; i < SOAP_BLKLEN; i++)
18073  {
18074  m = 0;
18075  j = 0;
18076 
18077  while (j < 4)
18078  {
18079  c = *s++;
18080 
18081  if (c == '=' || !c)
18082  {
18083  i *= 3;
18084 
18085  switch (j)
18086  {
18087  case 2:
18088  *t++ = (char)((m >> 4) & 0xFF);
18089  i++;
18090  break;
18091  case 3:
18092  *t++ = (char)((m >> 10) & 0xFF);
18093  *t++ = (char)((m >> 2) & 0xFF);
18094  i += 2;
18095  }
18096 
18097  if (n)
18098  *n += i;
18099 
18100  return p;
18101  }
18102 
18103  c -= '+';
18104 
18105  if (c >= 0 && c <= 79)
18106  {
18107  int b = soap_base64i[c];
18108 
18109  if (b >= 64)
18110  {
18111  soap->error = SOAP_TYPE;
18112  return NULL;
18113  }
18114 
18115  m = (m << 6) + b;
18116  j++;
18117  }
18118  else if (!soap_blank(c + '+'))
18119  {
18120  soap->error = SOAP_TYPE;
18121  return NULL;
18122  }
18123  }
18124 
18125  *t++ = (char)((m >> 16) & 0xFF);
18126  *t++ = (char)((m >> 8) & 0xFF);
18127  *t++ = (char)(m & 0xFF);
18128 
18129  if (l < 3)
18130  {
18131  if (n)
18132  *n += i;
18133 
18134  return p;
18135  }
18136 
18137  l -= 3;
18138  }
18139 
18140  if (n)
18141  *n += 3 * SOAP_BLKLEN;
18142  }
18143  }
int error
Definition: stdsoap2.h:1755
#define SOAP_NON_NULL
Definition: stdsoap2.cpp:311
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define soap_blank(c)
Definition: stdsoap2.cpp:118
#define SOAP_BLKLEN
Definition: stdsoap2.h:841
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
static const char soap_base64i[81]
Definition: stdsoap2.cpp:294
void soap_begin ( struct soap )

Definition at line 8685 of file stdsoap2.cpp.

References soap::ahead, soap::alloced, soap::bufidx, soap_dime::buflen, soap::buflen, soap::cdata, soap_dime::chunksize, soap::count, DBGLOG, soap::dime, soap::encoding, soap::endpoint, soap::error, soap::idnum, soap::imode, soap::keep_alive, soap::length, soap::level, soap::mode, soap::mustUnderstand, soap::ns, soap::null, soap::omode, soap::part, soap::peeked, soap::position, SOAP_END, soap_free_temp(), SOAP_IO_KEEPALIVE, and SOAP_OK.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_init().

8686  {
8687  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reinitializing context\n"));
8688 
8689  if (!soap->keep_alive)
8690  {
8691  soap->buflen = 0;
8692  soap->bufidx = 0;
8693  }
8694 
8695  soap->keep_alive = (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0);
8696  soap->null = 0;
8697  soap->position = 0;
8698  soap->encoding = 0;
8699  soap->mustUnderstand = 0;
8700  soap->mode = 0;
8701  soap->ns = 0;
8702  soap->part = SOAP_END;
8703  soap->alloced = 0;
8704  soap->count = 0;
8705  soap->length = 0;
8706  soap->cdata = 0;
8707  soap->error = SOAP_OK;
8708  soap->peeked = 0;
8709  soap->ahead = 0;
8710  soap->idnum = 0;
8711  soap->level = 0;
8712  soap->endpoint[0] = '\0';
8713 #ifndef WITH_LEANER
8714  soap->dime.chunksize = 0;
8715  soap->dime.buflen = 0;
8716 #endif
8718  }
short alloced
Definition: stdsoap2.h:1730
short keep_alive
Definition: stdsoap2.h:1742
size_t chunksize
Definition: stdsoap2.h:1389
int error
Definition: stdsoap2.h:1755
void soap_free_temp(struct soap *soap)
Definition: stdsoap2.cpp:8060
short part
Definition: stdsoap2.h:1729
soap_mode imode
Definition: stdsoap2.h:1602
soap_mode mode
Definition: stdsoap2.h:1601
short ns
Definition: stdsoap2.h:1728
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_dime dime
Definition: stdsoap2.h:1760
short peeked
Definition: stdsoap2.h:1731
soap_wchar ahead
Definition: stdsoap2.h:1701
soap_mode omode
Definition: stdsoap2.h:1603
short encoding
Definition: stdsoap2.h:1725
short cdata
Definition: stdsoap2.h:1702
size_t bufidx
Definition: stdsoap2.h:1699
#define SOAP_END
Definition: stdsoap2.h:1162
short mustUnderstand
Definition: stdsoap2.h:1726
#define SOAP_OK
Definition: stdsoap2.h:995
int idnum
Definition: stdsoap2.h:1633
size_t length
Definition: stdsoap2.h:1706
short position
Definition: stdsoap2.h:1721
size_t buflen
Definition: stdsoap2.h:1390
char endpoint[(1024)]
Definition: stdsoap2.h:1734
#define SOAP_IO_KEEPALIVE
Definition: stdsoap2.h:1095
short null
Definition: stdsoap2.h:1727
size_t buflen
Definition: stdsoap2.h:1700
size_t count
Definition: stdsoap2.h:1705
int soap_begin_count ( struct soap )

Definition at line 6421 of file stdsoap2.cpp.

References soap_dime::count, soap::count, DBGLOG, soap::dime, soap::encoding, soap::encodingStyle, soap::error, soap::fprepareinit, soap::fpreparesend, soap::idnum, soap_dime::last, soap_dime::list, soap::mode, soap::mustUnderstand, soap::ns, soap::null, soap::omode, soap::part, soap::position, soap_dime::size, SOAP_BEGIN, soap_clr_attr(), SOAP_ENC_DIME, SOAP_ENC_MIME, SOAP_ENC_MTOM, SOAP_ENC_XML, SOAP_ENC_ZLIB, soap_free_ns(), SOAP_IO, SOAP_IO_BUFFER, SOAP_IO_CHUNK, SOAP_IO_FLUSH, SOAP_IO_LENGTH, SOAP_IO_STORE, SOAP_OK, soap_select_mime_boundary(), soap_set_local_namespaces(), SOAP_XML_GRAPH, SOAP_XML_TREE, and soap::socket.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_send_fault().

6422  {
6423  soap_free_ns(soap);
6424 #ifndef WITH_LEANER
6425 
6426  if ((soap->mode & SOAP_ENC_DIME) || (soap->omode & SOAP_ENC_DIME))
6428  else
6429 #endif
6430 
6431  {
6432  soap->mode = soap->omode;
6433 
6434  if ((soap->mode & SOAP_IO) == SOAP_IO_STORE
6435  || (((soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_ENC_XML))
6436 #ifndef WITH_LEANER
6437  && !soap->fpreparesend
6438 #endif
6439  ))
6440  soap->mode &= ~SOAP_IO_LENGTH;
6441  else
6442  soap->mode |= SOAP_IO_LENGTH;
6443  }
6444 
6445 #ifdef WITH_ZLIB
6446 
6447  if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
6448  {
6449  if (!(soap->mode & SOAP_ENC_DIME))
6450  soap->mode &= ~SOAP_IO_LENGTH;
6451 
6452  if (soap->mode & SOAP_ENC_XML)
6453  soap->mode |= SOAP_IO_BUFFER;
6454  else
6455  soap->mode |= SOAP_IO_STORE;
6456  }
6457 
6458 #endif
6459 
6460  if (!soap->encodingStyle && !(soap->mode & SOAP_XML_GRAPH))
6461  soap->mode |= SOAP_XML_TREE;
6462 
6463 #ifndef WITH_LEANER
6464 
6465  if ((soap->mode & SOAP_ENC_MTOM) && (soap->mode & SOAP_ENC_DIME))
6466  soap->mode |= SOAP_ENC_MIME;
6467  else
6468  soap->mode &= ~SOAP_ENC_MTOM;
6469 
6470  if (soap->mode & SOAP_ENC_MIME)
6472 
6473  soap->dime.list = soap->dime.last; /* keep track of last DIME attachment */
6474 #endif
6475  soap->count = 0;
6476  soap->ns = 0;
6477  soap->null = 0;
6478  soap->position = 0;
6479  soap->mustUnderstand = 0;
6480  soap->encoding = 0;
6481  soap->part = SOAP_BEGIN;
6482  soap->idnum = 0;
6485  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin count phase (socket=%d mode=0x%x count=%lu)\n", soap->socket, soap->mode, (unsigned long)soap->count));
6486 #ifndef WITH_LEANER
6487  soap->dime.count = 0; /* count # of attachments */
6488  soap->dime.size = 0; /* accumulate total size of attachments */
6489 
6490  if (soap->fprepareinit && (soap->mode & SOAP_IO) != SOAP_IO_STORE)
6491  return soap->error = soap->fprepareinit(soap);
6492 
6493 #endif
6494  return SOAP_OK;
6495  }
#define SOAP_XML_GRAPH
Definition: stdsoap2.h:1111
int error
Definition: stdsoap2.h:1755
short part
Definition: stdsoap2.h:1729
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1101
size_t size
Definition: stdsoap2.h:1388
#define SOAP_BEGIN
Definition: stdsoap2.h:1154
short ns
Definition: stdsoap2.h:1728
#define SOAP_IO_FLUSH
Definition: stdsoap2.h:1087
#define SOAP_IO
Definition: stdsoap2.h:1086
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_multipart * list
Definition: stdsoap2.h:1396
void soap_set_local_namespaces(struct soap *soap)
Definition: stdsoap2.cpp:8831
struct soap_dime dime
Definition: stdsoap2.h:1760
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
#define SOAP_XML_TREE
Definition: stdsoap2.h:1110
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
int(* fpreparesend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1667
soap_mode omode
Definition: stdsoap2.h:1603
size_t count
Definition: stdsoap2.h:1387
short encoding
Definition: stdsoap2.h:1725
#define SOAP_IO_BUFFER
Definition: stdsoap2.h:1088
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1102
struct soap_multipart * last
Definition: stdsoap2.h:1397
short mustUnderstand
Definition: stdsoap2.h:1726
int(* fprepareinit)(struct soap *)
Definition: stdsoap2.h:1666
#define SOAP_OK
Definition: stdsoap2.h:995
int idnum
Definition: stdsoap2.h:1633
#define SOAP_IO_STORE
Definition: stdsoap2.h:1089
short position
Definition: stdsoap2.h:1721
static void soap_select_mime_boundary(struct soap *)
Definition: stdsoap2.cpp:15582
#define SOAP_ENC_XML
Definition: stdsoap2.h:1098
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
int socket
Definition: stdsoap2.h:1684
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
short null
Definition: stdsoap2.h:1727
void soap_clr_attr(struct soap *soap)
Definition: stdsoap2.cpp:10164
static void soap_free_ns(struct soap *soap)
Definition: stdsoap2.cpp:8135
const char * encodingStyle
Definition: stdsoap2.h:1609
size_t count
Definition: stdsoap2.h:1705
int soap_begin_recv ( struct soap )

Definition at line 16617 of file stdsoap2.cpp.

References soap::action, soap::ahead, soap::alloced, soap_mime::boundary, soap::buf, soap::bufidx, soap_dime::buflen, soap::buflen, soap::cdata, soap::chunkbuflen, soap_dime::chunksize, soap::chunksize, soap::count, soap::d_stream, DBGLOG, soap::dime, soap::dom, soap::endpoint, soap::error, soap::fault, soap::fform, soap_dime::first, soap_mime::first, soap_dime::flags, soap::fparse, soap::fprepareinit, soap::fpreparerecv, soap::header, soap_multipart::id, if(), soap::imode, soap::keep_alive, soap_dime::last, soap_mime::last, soap::length, soap::level, soap_dime::list, soap_mime::list, soap::mime, soap::mode, soap::omode, soap::part, soap::peeked, soap::recvfd, soap_dime::size, SOAP_BEGIN, soap_blank, SOAP_BUFLEN, SOAP_DIME_CF, SOAP_DIME_MB, SOAP_DIME_VERSION, SOAP_ENC_DIME, SOAP_ENC_MIME, SOAP_ENC_ZLIB, SOAP_EOF, SOAP_FORM, soap_free_iht(), soap_free_temp(), soap_get0, soap_get1, soap_get_header_attribute(), soap_get_mime_attachment(), soap_getchar(), soap_getdimehdr(), soap_getmimehdr(), SOAP_IO, SOAP_IO_CHUNK, SOAP_IO_KEEPALIVE, SOAP_MALLOC, soap_match_cid(), SOAP_NO_DATA, SOAP_OK, soap_revget1, soap_set_local_namespaces(), SOAP_STOP, soap_unget, soap_valid_socket, SOAP_ZLIB_DEFLATE, SOAP_ZLIB_ERROR, SOAP_ZLIB_GZIP, SOAP_ZLIB_INFLATE, SOAP_ZLIB_NONE, soap::socket, soap::ssl, soap_mime::start, soap::status, soap_multipart::type, soap::version, soap::z_buf, soap::z_buflen, soap::z_crc, soap::z_ratio_in, soap::zlib_in, soap::zlib_out, and soap::zlib_state.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_recv_empty_response().

16618  {
16619  soap_wchar c;
16620  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for input\n"));
16621  soap->error = SOAP_OK;
16624  soap->version = 0; /* don't assume we're parsing SOAP content by default */
16625 #ifndef WITH_NOIDREF
16627 #endif
16628 
16629  if ((soap->imode & SOAP_IO) == SOAP_IO_CHUNK)
16630  soap->omode |= SOAP_IO_CHUNK;
16631 
16632  soap->imode &= ~(SOAP_IO | SOAP_ENC_MIME);
16633  soap->mode = soap->imode;
16634 
16635  if (!soap->keep_alive)
16636  {
16637  soap->buflen = 0;
16638  soap->bufidx = 0;
16639  }
16640 
16641  if (!(soap->mode & SOAP_IO_KEEPALIVE))
16642  soap->keep_alive = 0;
16643 
16644  soap->ahead = 0;
16645  soap->peeked = 0;
16646  soap->level = 0;
16647  soap->part = SOAP_BEGIN;
16648  soap->alloced = 0;
16649  soap->count = 0;
16650  soap->length = 0;
16651  soap->cdata = 0;
16652  *soap->endpoint = '\0';
16653  soap->action = NULL;
16654  soap->header = NULL;
16655  soap->fault = NULL;
16656  soap->status = 0;
16657 #ifndef WITH_LEANER
16658  soap->dom = NULL;
16659  soap->dime.chunksize = 0;
16660  soap->dime.buflen = 0;
16661  soap->dime.list = NULL;
16662  soap->dime.first = NULL;
16663  soap->dime.last = NULL;
16664  soap->mime.list = NULL;
16665  soap->mime.first = NULL;
16666  soap->mime.last = NULL;
16667  soap->mime.boundary = NULL;
16668  soap->mime.start = NULL;
16669 #endif
16670 #ifdef WIN32
16671 #ifndef UNDER_CE
16672 #ifndef WITH_FASTCGI
16673 
16675  _setmode(soap->recvfd, _O_BINARY);
16676 
16677 #endif
16678 #endif
16679 #endif
16680 #ifdef WITH_ZLIB
16681  soap->mode &= ~SOAP_ENC_ZLIB;
16684  soap->d_stream->next_in = Z_NULL;
16685  soap->d_stream->avail_in = 0;
16686  soap->d_stream->next_out = (Byte*)soap->buf;
16687  soap->d_stream->avail_out = SOAP_BUFLEN;
16688  soap->z_ratio_in = 1.0;
16689 #endif
16690 #ifdef WITH_OPENSSL
16691 
16692  if (soap->ssl)
16693  ERR_clear_error();
16694 
16695 #endif
16696 #ifndef WITH_LEANER
16697 
16698  if (soap->fprepareinit)
16700 
16701 #endif
16702  c = soap_getchar(soap);
16703 #ifdef WITH_GZIP
16704 
16705  if (c == 0x1F)
16706  {
16707  if (soap_getgziphdr(soap))
16708  return soap->error;
16709 
16710  if (inflateInit2(soap->d_stream, -MAX_WBITS) != Z_OK)
16711  return soap->error = SOAP_ZLIB_ERROR;
16712 
16714  soap->mode |= SOAP_ENC_ZLIB;
16716  soap->z_crc = crc32(0L, NULL, 0);
16717  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n"));
16718 
16719  if (!soap->z_buf)
16720  soap->z_buf = (char*)SOAP_MALLOC(soap, SOAP_BUFLEN);
16721 
16722  memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
16723  /* should not chunk over plain transport, so why bother to check? */
16724  /* if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) */
16725  /* soap->z_buflen = soap->bufidx; */
16726  /* else */
16727  soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx);
16728  soap->d_stream->avail_in = soap->buflen - soap->bufidx;
16729  soap->z_buflen = soap->buflen;
16730  soap->buflen = soap->bufidx;
16731  c = soap_getchar(soap);
16732  }
16733 
16734 #endif
16735 #ifndef WITH_LEANER
16736 
16737  if (c == '-' && soap_get0(soap) == '-')
16738  soap->mode |= SOAP_ENC_MIME;
16739  else if ((c & 0xFFFC) == (SOAP_DIME_VERSION | SOAP_DIME_MB) && (soap_get0(soap) & 0xFFF0) == 0x20)
16740  soap->mode |= SOAP_ENC_DIME;
16741  else
16742 #endif
16743 
16744  {
16745  while (soap_blank(c))
16746  c = soap_getchar(soap);
16747  }
16748 
16749  if ((int)c == EOF)
16750  return soap->error = SOAP_EOF;
16751 
16752  soap_unget(soap, c);
16753 #ifndef WITH_NOHTTP
16754 
16755  /* if not XML or (start of)BOM or MIME/DIME/ZLIB, assume HTTP header */
16756  if (c != '<' && c != 0xEF && !(soap->mode & (SOAP_ENC_MIME | SOAP_ENC_DIME | SOAP_ENC_ZLIB)))
16757  {
16758  soap_mode m = soap->imode;
16759  soap->mode &= ~SOAP_IO;
16760  soap->error = soap->fparse(soap);
16761 
16762  if (soap->error && soap->error < SOAP_STOP)
16763  {
16764  soap->keep_alive = 0; /* force close later */
16765  return soap->error;
16766  }
16767 
16768  if (soap->error == SOAP_STOP)
16769  return soap->error;
16770 
16771  soap->mode = soap->imode; /* if imode is changed, effectuate */
16772  soap->imode = m; /* restore imode */
16773 #ifdef WITH_ZLIB
16774  soap->mode &= ~SOAP_ENC_ZLIB;
16775 #endif
16776 
16777  if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
16778  {
16780  soap->buflen = soap->bufidx;
16781  soap->chunksize = 0;
16782  }
16783 
16784 #ifndef WITH_LEANER
16785  else if (soap->fpreparerecv && soap->buflen != soap->bufidx)
16787 
16788 #endif
16789 
16790  /* Note: fparse should not use soap_unget to push back last char */
16791  if (soap_get0(soap) == (int)EOF)
16792  {
16793  if (soap->status == 200)
16794  return soap->error = SOAP_NO_DATA; /* HTTP OK: always expect data */
16795 
16796  return soap->error = soap->status;
16797  }
16798 
16799 #ifdef WITH_ZLIB
16800 
16801  if (soap->zlib_in != SOAP_ZLIB_NONE)
16802  {
16803 #ifdef WITH_GZIP
16804 
16805  if (soap->zlib_in != SOAP_ZLIB_DEFLATE)
16806  {
16807  c = soap_get1(soap);
16808 
16809  if (c == 0x1F)
16810  {
16811  if (soap_getgziphdr(soap))
16812  return soap->error;
16813 
16814  if (inflateInit2(soap->d_stream, -MAX_WBITS) != Z_OK)
16815  return soap->error = SOAP_ZLIB_ERROR;
16816 
16817  soap->z_crc = crc32(0L, NULL, 0);
16818  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n"));
16819  }
16820  else
16821  {
16822  soap_revget1(soap);
16823 
16824  if (inflateInit(soap->d_stream) != Z_OK)
16825  return soap->error = SOAP_ZLIB_ERROR;
16826 
16828  }
16829  }
16830  else
16831 #endif
16832  if (inflateInit(soap->d_stream) != Z_OK)
16833  return soap->error = SOAP_ZLIB_ERROR;
16834 
16836  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate initialized\n"));
16837  soap->mode |= SOAP_ENC_ZLIB;
16838 
16839  if (!soap->z_buf)
16840  soap->z_buf = (char*)SOAP_MALLOC(soap, SOAP_BUFLEN);
16841 
16842  memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
16843  soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx);
16844  soap->d_stream->avail_in = soap->buflen - soap->bufidx;
16845  soap->z_buflen = soap->buflen;
16846  soap->buflen = soap->bufidx;
16847  }
16848 
16849 #endif
16850 
16851  if (soap->error)
16852  {
16853  if (soap->error == SOAP_FORM && soap->fform)
16854  {
16855  soap->error = soap->fform(soap);
16856 
16857  if (soap->error == SOAP_OK)
16858  soap->error = SOAP_STOP; /* prevents further processing */
16859  }
16860 
16861  return soap->error;
16862  }
16863  }
16864 
16865 #endif
16866 #ifndef WITH_LEANER
16867 
16868  if (soap->mode & SOAP_ENC_MIME)
16869  {
16870  if (soap_getmimehdr(soap))
16871  return soap->error;
16872 
16873  if (soap->mime.start)
16874  {
16875  do
16876  {
16877  if (!soap->mime.last->id)
16878  break;
16879 
16881  break;
16882  }
16883  while (soap_get_mime_attachment(soap, NULL));
16884  }
16885 
16886  if (soap_get_header_attribute(soap, soap->mime.first->type, "application/dime"))
16887  soap->mode |= SOAP_ENC_DIME;
16888  }
16889 
16890  if (soap->mode & SOAP_ENC_DIME)
16891  {
16892  if (soap_getdimehdr(soap))
16893  return soap->error;
16894 
16895  if (soap->dime.flags & SOAP_DIME_CF)
16896  {
16897  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked DIME SOAP message\n"));
16899 
16900  if (soap->buflen - soap->bufidx >= soap->dime.chunksize)
16901  {
16902  soap->dime.buflen = soap->buflen;
16904  }
16905  else
16907  }
16908 
16909  soap->count = soap->buflen - soap->bufidx;
16910  }
16911 
16912 #endif
16913  return SOAP_OK;
16914  }
const char * id
Definition: stdsoap2.h:1444
short alloced
Definition: stdsoap2.h:1730
short keep_alive
Definition: stdsoap2.h:1742
int recvfd
Definition: stdsoap2.h:1694
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
size_t chunksize
Definition: stdsoap2.h:1389
int error
Definition: stdsoap2.h:1755
struct soap_multipart * first
Definition: stdsoap2.h:1413
struct soap_multipart * list
Definition: stdsoap2.h:1412
#define soap_valid_socket(n)
Definition: stdsoap2.h:698
void soap_free_temp(struct soap *soap)
Definition: stdsoap2.cpp:8060
short part
Definition: stdsoap2.h:1729
char * action
Definition: stdsoap2.h:1737
soap_mode imode
Definition: stdsoap2.h:1602
soap_mode mode
Definition: stdsoap2.h:1601
struct soap_multipart * first
Definition: stdsoap2.h:1397
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
size_t size
Definition: stdsoap2.h:1388
#define SOAP_BEGIN
Definition: stdsoap2.h:1154
size_t chunksize
Definition: stdsoap2.h:1732
short version
Definition: stdsoap2.h:1600
#define SOAP_IO
Definition: stdsoap2.h:1086
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_ZLIB_NONE
Definition: stdsoap2.h:1077
struct soap_multipart * list
Definition: stdsoap2.h:1396
struct soap_multipart * soap_get_mime_attachment(struct soap *soap, void *handle)
Definition: stdsoap2.cpp:15054
#define SOAP_ZLIB_INFLATE
Definition: stdsoap2.h:1079
int32_t z_crc
Definition: stdsoap2.h:1823
void soap_set_local_namespaces(struct soap *soap)
Definition: stdsoap2.cpp:8831
struct soap_dime dime
Definition: stdsoap2.h:1760
size_t z_buflen
Definition: stdsoap2.h:1829
short zlib_state
Definition: stdsoap2.h:1825
int(* fform)(struct soap *)
Definition: stdsoap2.h:1643
#define SOAP_ZLIB_DEFLATE
Definition: stdsoap2.h:1078
int soap_getmimehdr(struct soap *soap)
Definition: stdsoap2.cpp:14923
short peeked
Definition: stdsoap2.h:1731
#define SOAP_ZLIB_GZIP
Definition: stdsoap2.h:1080
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
soap_wchar ahead
Definition: stdsoap2.h:1701
int32_t soap_mode
Definition: stdsoap2.h:1084
#define soap_blank(c)
Definition: stdsoap2.cpp:118
void * d_stream
Definition: stdsoap2.h:1822
char buf[(65536)]
Definition: stdsoap2.h:1710
#define soap_revget1(soap)
Definition: stdsoap2.h:1899
#define SOAP_STOP
Definition: stdsoap2.h:1056
#define SOAP_DIME_VERSION
Definition: stdsoap2.h:1071
soap_mode omode
Definition: stdsoap2.h:1603
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
void * ssl
Definition: stdsoap2.h:1799
soap_wchar soap_getchar(struct soap *soap)
Definition: stdsoap2.cpp:1616
const char * start
Definition: stdsoap2.h:1411
static void soap_free_iht(struct soap *)
Definition: stdsoap2.cpp:7004
short cdata
Definition: stdsoap2.h:1702
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1102
struct SOAP_ENV__Header * header
Definition: stdsoap2.h:1631
float z_ratio_in
Definition: stdsoap2.h:1831
struct soap_multipart * last
Definition: stdsoap2.h:1397
#define SOAP_FORM
Definition: stdsoap2.h:1057
struct soap_multipart * last
Definition: stdsoap2.h:1413
size_t bufidx
Definition: stdsoap2.h:1699
#define SOAP_DIME_CF
Definition: stdsoap2.h:1068
int soap_getdimehdr(struct soap *soap)
Definition: stdsoap2.cpp:14690
char * boundary
Definition: stdsoap2.h:1410
int(* fprepareinit)(struct soap *)
Definition: stdsoap2.h:1666
#define SOAP_OK
Definition: stdsoap2.h:995
short zlib_in
Definition: stdsoap2.h:1826
char * z_buf
Definition: stdsoap2.h:1828
int status
Definition: stdsoap2.h:1754
const char * soap_get_header_attribute(struct soap *soap, const char *line, const char *key)
Definition: stdsoap2.cpp:17301
int soap_match_cid(struct soap *soap, const char *s, const char *t)
Definition: stdsoap2.cpp:15216
#define soap_get1(soap)
Definition: stdsoap2.h:1893
#define soap_get0(soap)
Definition: stdsoap2.h:1892
size_t length
Definition: stdsoap2.h:1706
char flags
Definition: stdsoap2.h:1391
#define SOAP_NO_DATA
Definition: stdsoap2.h:1009
int(* fpreparerecv)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1668
size_t chunkbuflen
Definition: stdsoap2.h:1733
#define SOAP_ZLIB_ERROR
Definition: stdsoap2.h:1026
struct soap_mime mime
Definition: stdsoap2.h:1761
#define SOAP_EOF
Definition: stdsoap2.h:993
if(!yymsg) yymsg
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
size_t buflen
Definition: stdsoap2.h:1390
int socket
Definition: stdsoap2.h:1684
const char * type
Definition: stdsoap2.h:1445
char endpoint[(1024)]
Definition: stdsoap2.h:1734
#define SOAP_IO_KEEPALIVE
Definition: stdsoap2.h:1095
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
int32_t soap_wchar
Definition: stdsoap2.h:1257
size_t buflen
Definition: stdsoap2.h:1700
int(* fparse)(struct soap *)
Definition: stdsoap2.h:1646
short zlib_out
Definition: stdsoap2.h:1827
#define SOAP_DIME_MB
Definition: stdsoap2.h:1070
size_t count
Definition: stdsoap2.h:1705
int soap_begin_send ( struct soap )

Definition at line 6521 of file stdsoap2.cpp.

References soap::bufidx, soap::buflen, soap::chunksize, soap::count, soap::d_stream, DBGLOG, soap::encoding, soap::encodingStyle, soap::error, soap::fprepareinit, soap::idnum, if(), soap::keep_alive, soap::level, soap::mode, soap::mustUnderstand, soap::ns, soap::null, soap::omode, soap::part, soap::position, soap::sendfd, SOAP_BEGIN, SOAP_BUFLEN, soap_clr_attr(), SOAP_ENC_DIME, SOAP_ENC_MIME, SOAP_ENC_MTOM, SOAP_ENC_XML, SOAP_ENC_ZLIB, soap_free_ns(), SOAP_IO, SOAP_IO_BUFFER, SOAP_IO_FLUSH, SOAP_IO_KEEPALIVE, SOAP_IO_LENGTH, SOAP_IO_STORE, SOAP_IO_UDP, SOAP_MALLOC, soap_new_block(), SOAP_OK, soap_select_mime_boundary(), soap_set_local_namespaces(), SOAP_UDP_ERROR, soap_valid_socket, SOAP_XML_GRAPH, SOAP_XML_TREE, SOAP_ZLIB_DEFLATE, SOAP_ZLIB_ERROR, SOAP_ZLIB_GZIP, soap::socket, soap::ssl, soap::z_buf, soap::z_crc, soap::z_level, soap::z_ratio_out, soap::zlib_out, and soap::zlib_state.

Referenced by soap_response(), soap_try_connect_command(), and tcp_connect().

6522  {
6523  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing for output\n"));
6524  soap_free_ns(soap);
6525  soap->error = SOAP_OK;
6527 #ifdef WITH_ZLIB
6528 
6529  if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
6530  {
6531  if (soap->mode & SOAP_ENC_XML)
6532  soap->mode |= SOAP_IO_BUFFER;
6533  else
6534  soap->mode |= SOAP_IO_STORE;
6535  }
6536 
6537 #endif
6538 #ifndef WITH_LEAN
6539 
6540  if ((soap->mode & SOAP_IO_UDP))
6541  {
6542  soap->mode |= SOAP_ENC_XML;
6543 
6544  if (soap->count > SOAP_BUFLEN)
6545  return soap->error = SOAP_UDP_ERROR;
6546  }
6547 
6548 #endif
6549 
6551  {
6552  if (soap->count || (soap->mode & SOAP_IO_LENGTH) || (soap->mode & SOAP_ENC_XML))
6553  soap->mode |= SOAP_IO_BUFFER;
6554  else
6555  soap->mode |= SOAP_IO_STORE;
6556  }
6557 
6558  soap->mode &= ~SOAP_IO_LENGTH;
6559 
6560  if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
6561  if (soap_new_block(soap) == NULL)
6562  return soap->error;
6563 
6564  if (!(soap->mode & SOAP_IO_KEEPALIVE))
6565  soap->keep_alive = 0;
6566 
6568  soap->mode |= SOAP_XML_TREE;
6569 
6570 #ifndef WITH_LEANER
6571 
6573  {
6574  soap->mode |= SOAP_ENC_MIME;
6575  soap->mode &= ~SOAP_ENC_DIME;
6576  }
6577  else
6578  soap->mode &= ~SOAP_ENC_MTOM;
6579 
6580  if (soap->mode & SOAP_ENC_MIME)
6582 
6583 #ifdef WIN32
6584 #ifndef UNDER_CE
6585 #ifndef WITH_FASTCGI
6586 
6587  if (!soap_valid_socket(soap->socket)) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
6588  _setmode(soap->sendfd, _O_BINARY);
6589 
6590 #endif
6591 #endif
6592 #endif
6593 #endif
6594 
6595  if (soap->mode & SOAP_IO)
6596  {
6597  soap->bufidx = 0;
6598  soap->buflen = 0;
6599  }
6600 
6601  soap->chunksize = 0;
6602  soap->ns = 0;
6603  soap->null = 0;
6604  soap->position = 0;
6605  soap->mustUnderstand = 0;
6606  soap->encoding = 0;
6607  soap->idnum = 0;
6608  soap->level = 0;
6611 #ifdef WITH_ZLIB
6612  soap->z_ratio_out = 1.0;
6613 
6615  {
6616  if (!soap->z_buf)
6617  soap->z_buf = (char*)SOAP_MALLOC(soap, SOAP_BUFLEN);
6618 
6619  soap->d_stream->next_out = (Byte*)soap->z_buf;
6620  soap->d_stream->avail_out = SOAP_BUFLEN;
6621 #ifdef WITH_GZIP
6622 
6624  {
6625  memcpy(soap->z_buf, "\37\213\10\0\0\0\0\0\0\377", 10);
6626  soap->d_stream->next_out = (Byte*)soap->z_buf + 10;
6627  soap->d_stream->avail_out = SOAP_BUFLEN - 10;
6628  soap->z_crc = crc32(0L, NULL, 0);
6630 
6631  if (deflateInit2(soap->d_stream, soap->z_level, Z_DEFLATED, -MAX_WBITS, 8, Z_DEFAULT_STRATEGY) != Z_OK)
6632  return soap->error = SOAP_ZLIB_ERROR;
6633  }
6634  else
6635 #endif
6636  if (deflateInit(soap->d_stream, soap->z_level) != Z_OK)
6637  return soap->error = SOAP_ZLIB_ERROR;
6638 
6639  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflate initialized\n"));
6641  }
6642 
6643 #endif
6644 #ifdef WITH_OPENSSL
6645 
6646  if (soap->ssl)
6647  ERR_clear_error();
6648 
6649 #endif
6650  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin send phase (socket=%d mode=0x%x count=%lu)\n", soap->socket, soap->mode, (unsigned long)soap->count));
6651  soap->part = SOAP_BEGIN;
6652 #ifndef WITH_LEANER
6653 
6654  if (soap->fprepareinit && (soap->mode & SOAP_IO) == SOAP_IO_STORE)
6656 
6657 #endif
6658  return SOAP_OK;
6659  }
short keep_alive
Definition: stdsoap2.h:1742
#define SOAP_XML_GRAPH
Definition: stdsoap2.h:1111
unsigned short z_level
Definition: stdsoap2.h:1830
int error
Definition: stdsoap2.h:1755
#define soap_valid_socket(n)
Definition: stdsoap2.h:698
int sendfd
Definition: stdsoap2.h:1693
short part
Definition: stdsoap2.h:1729
#define SOAP_UDP_ERROR
Definition: stdsoap2.h:1022
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1101
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
#define SOAP_BEGIN
Definition: stdsoap2.h:1154
short ns
Definition: stdsoap2.h:1728
#define SOAP_IO_UDP
Definition: stdsoap2.h:1092
size_t chunksize
Definition: stdsoap2.h:1732
#define SOAP_IO_FLUSH
Definition: stdsoap2.h:1087
#define SOAP_IO
Definition: stdsoap2.h:1086
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int32_t z_crc
Definition: stdsoap2.h:1823
void soap_set_local_namespaces(struct soap *soap)
Definition: stdsoap2.cpp:8831
short zlib_state
Definition: stdsoap2.h:1825
#define SOAP_ZLIB_DEFLATE
Definition: stdsoap2.h:1078
#define SOAP_ZLIB_GZIP
Definition: stdsoap2.h:1080
struct soap_blist * soap_new_block(struct soap *soap)
Definition: stdsoap2.cpp:2728
#define SOAP_XML_TREE
Definition: stdsoap2.h:1110
void * d_stream
Definition: stdsoap2.h:1822
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
float z_ratio_out
Definition: stdsoap2.h:1832
soap_mode omode
Definition: stdsoap2.h:1603
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
short encoding
Definition: stdsoap2.h:1725
void * ssl
Definition: stdsoap2.h:1799
#define SOAP_IO_BUFFER
Definition: stdsoap2.h:1088
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1102
size_t bufidx
Definition: stdsoap2.h:1699
short mustUnderstand
Definition: stdsoap2.h:1726
int(* fprepareinit)(struct soap *)
Definition: stdsoap2.h:1666
#define SOAP_OK
Definition: stdsoap2.h:995
char * z_buf
Definition: stdsoap2.h:1828
int idnum
Definition: stdsoap2.h:1633
#define SOAP_IO_STORE
Definition: stdsoap2.h:1089
short position
Definition: stdsoap2.h:1721
static void soap_select_mime_boundary(struct soap *)
Definition: stdsoap2.cpp:15582
#define SOAP_ZLIB_ERROR
Definition: stdsoap2.h:1026
#define SOAP_ENC_XML
Definition: stdsoap2.h:1098
if(!yymsg) yymsg
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
int socket
Definition: stdsoap2.h:1684
#define SOAP_IO_KEEPALIVE
Definition: stdsoap2.h:1095
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
short null
Definition: stdsoap2.h:1727
void soap_clr_attr(struct soap *soap)
Definition: stdsoap2.cpp:10164
size_t buflen
Definition: stdsoap2.h:1700
static void soap_free_ns(struct soap *soap)
Definition: stdsoap2.cpp:8135
const char * encodingStyle
Definition: stdsoap2.h:1609
short zlib_out
Definition: stdsoap2.h:1827
size_t count
Definition: stdsoap2.h:1705
int soap_bind ( struct soap ,
const char *  ,
int  ,
int   
)

Definition at line 5457 of file stdsoap2.cpp.

References soap::bind_flags, DBGLOG, soap::errmode, soap::errnum, soap::fclosesocket, soap::fresolve, soap::imode, soap::master, soap::omode, soap::peer, soap::peerlen, SOAP_BUFLEN, soap_closesock(), SOAP_GAI_STRERROR, soap_int2s(), SOAP_INVALID_SOCKET, SOAP_IO_KEEPALIVE, SOAP_IO_UDP, soap_set_receiver_error(), soap_socket_errno, SOAP_TCP_ERROR, soap_valid_socket, soap::socket, tcp_error(), and tcp_init().

5458  {
5459 #ifdef WITH_IPV6
5460  struct addrinfo *addrinfo = NULL;
5461  struct addrinfo hints;
5462  struct addrinfo res;
5463  int err;
5464 #ifdef IPV6_V6ONLY
5465  int unset = 0;
5466 #ifdef SOL_IP
5467  int level = SOL_IP;
5468 #else
5469  int level = IPPROTO_IPV6;
5470 #endif
5471 #endif
5472 #endif
5473 #ifndef WITH_LEAN
5474  int len = SOAP_BUFLEN;
5475  int set = 1;
5476 #endif
5477 
5479  {
5482  }
5483 
5485  soap->errmode = 1;
5486 
5487  if (tcp_init(soap))
5488  {
5489  soap_set_receiver_error(soap, tcp_error(soap), "TCP init failed in soap_bind()", SOAP_TCP_ERROR);
5490  return SOAP_INVALID_SOCKET;
5491  }
5492 
5493 #ifdef WITH_IPV6
5494  memset((void*)&hints, 0, sizeof(hints));
5495  hints.ai_family = PF_UNSPEC;
5496 #ifndef WITH_LEAN
5497 
5498  if ((soap->omode & SOAP_IO_UDP))
5499  hints.ai_socktype = SOCK_DGRAM;
5500  else
5501 #endif
5502  hints.ai_socktype = SOCK_STREAM;
5503 
5504  hints.ai_flags = AI_PASSIVE;
5505  soap->errmode = 2;
5506  err = getaddrinfo(host, soap_int2s(soap, port), &hints, &addrinfo);
5507 
5508  if (addrinfo)
5509  {
5510  res = *addrinfo;
5511  memcpy(&soap->peer, addrinfo->ai_addr, addrinfo->ai_addrlen);
5512  soap->peerlen = addrinfo->ai_addrlen;
5513  res.ai_addr = (struct sockaddr*) & soap->peer;
5514  res.ai_addrlen = soap->peerlen;
5515  freeaddrinfo(addrinfo);
5516  }
5517 
5518  if (err || !addrinfo)
5519  {
5520  soap_set_receiver_error(soap, SOAP_GAI_STRERROR(err), "getaddrinfo failed in soap_bind()", SOAP_TCP_ERROR);
5521  return SOAP_INVALID_SOCKET;
5522  }
5523 
5524  soap->master = (int)socket(res.ai_family, res.ai_socktype, res.ai_protocol);
5525 #else
5526 #ifndef WITH_LEAN
5527 
5528  if ((soap->omode & SOAP_IO_UDP))
5529  soap->master = (int)socket(AF_INET, SOCK_DGRAM, 0);
5530  else
5531 #endif
5532  soap->master = (int)socket(AF_INET, SOCK_STREAM, 0);
5533 
5534 #endif
5535  soap->errmode = 0;
5536 
5537  if (!soap_valid_socket(soap->master))
5538  {
5540  soap_set_receiver_error(soap, tcp_error(soap), "socket failed in soap_bind()", SOAP_TCP_ERROR);
5541  return SOAP_INVALID_SOCKET;
5542  }
5543 
5544 #ifndef WITH_LEAN
5545 
5546  if ((soap->omode & SOAP_IO_UDP))
5547  soap->socket = soap->master;
5548 
5549 #endif
5550 #ifdef SOCKET_CLOSE_ON_EXEC
5551 #ifdef WIN32
5552 #ifndef UNDER_CE
5553  SetHandleInformation((HANDLE)soap->master, HANDLE_FLAG_INHERIT, 0);
5554 #endif
5555 #else
5556  fcntl(soap->master, F_SETFD, 1);
5557 #endif
5558 #endif
5559 #ifndef WITH_LEAN
5560 
5561  if (soap->bind_flags && setsockopt(soap->master, SOL_SOCKET, soap->bind_flags, (char*)&set, sizeof(int)))
5562  {
5564  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt failed in soap_bind()", SOAP_TCP_ERROR);
5565  return SOAP_INVALID_SOCKET;
5566  }
5567 
5568  if (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) && setsockopt(soap->master, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
5569  {
5571  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_KEEPALIVE failed in soap_bind()", SOAP_TCP_ERROR);
5572  return SOAP_INVALID_SOCKET;
5573  }
5574 
5575  if (setsockopt(soap->master, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
5576  {
5578  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_SNDBUF failed in soap_bind()", SOAP_TCP_ERROR);
5579  return SOAP_INVALID_SOCKET;
5580  }
5581 
5582  if (setsockopt(soap->master, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
5583  {
5585  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt SO_RCVBUF failed in soap_bind()", SOAP_TCP_ERROR);
5586  return SOAP_INVALID_SOCKET;
5587  }
5588 
5589 #ifdef TCP_NODELAY
5590 
5591  if (!(soap->omode & SOAP_IO_UDP) && setsockopt(soap->master, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
5592  {
5594  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt TCP_NODELAY failed in soap_bind()", SOAP_TCP_ERROR);
5595  return SOAP_INVALID_SOCKET;
5596  }
5597 
5598 #endif
5599 #endif
5600 #ifdef WITH_IPV6
5601 #ifdef IPV6_V6ONLY
5602 
5603  if (setsockopt(soap->master, level, IPV6_V6ONLY, (char*)&unset, sizeof(int)))
5604  {
5606  soap_set_receiver_error(soap, tcp_error(soap), "setsockopt IPV6_V6ONLY failed in soap_bind()", SOAP_TCP_ERROR);
5607  return SOAP_INVALID_SOCKET;
5608  }
5609 
5610 #endif
5611  soap->errmode = 0;
5612 
5613  if (bind(soap->master, res.ai_addr, (int)res.ai_addrlen))
5614  {
5616  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host\n"));
5618  soap_set_receiver_error(soap, tcp_error(soap), "bind failed in soap_bind()", SOAP_TCP_ERROR);
5619  return SOAP_INVALID_SOCKET;
5620  }
5621 
5622 #else
5623  soap->peerlen = sizeof(soap->peer);
5624  memset((void*)&soap->peer, 0, sizeof(soap->peer));
5625  soap->peer.sin_family = AF_INET;
5626  soap->errmode = 2;
5627 
5628  if (host)
5629  {
5630  if (soap->fresolve(soap, host, &soap->peer.sin_addr))
5631  {
5632  soap_set_receiver_error(soap, tcp_error(soap), "get host by name failed in soap_bind()", SOAP_TCP_ERROR);
5633  return SOAP_INVALID_SOCKET;
5634  }
5635  }
5636  else
5637  soap->peer.sin_addr.s_addr = htonl(INADDR_ANY);
5638 
5639  soap->peer.sin_port = htons((short)port);
5640  soap->errmode = 0;
5641 
5642  if (bind(soap->master, (struct sockaddr*)&soap->peer, (int)soap->peerlen))
5643  {
5645  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host\n"));
5647  soap_set_receiver_error(soap, tcp_error(soap), "bind failed in soap_bind()", SOAP_TCP_ERROR);
5648  return SOAP_INVALID_SOCKET;
5649  }
5650 
5651 #endif
5652 
5653  if (!(soap->omode & SOAP_IO_UDP) && listen(soap->master, backlog))
5654  {
5656  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host\n"));
5658  soap_set_receiver_error(soap, tcp_error(soap), "listen failed in soap_bind()", SOAP_TCP_ERROR);
5659  return SOAP_INVALID_SOCKET;
5660  }
5661 
5662  return soap->master;
5663  }
#define soap_socket_errno(s)
Definition: stdsoap2.h:803
#define soap_valid_socket(n)
Definition: stdsoap2.h:698
static int tcp_init(struct soap *)
Definition: stdsoap2.cpp:4292
soap_mode imode
Definition: stdsoap2.h:1602
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
#define SOAP_IO_UDP
Definition: stdsoap2.h:1092
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int errmode
Definition: stdsoap2.h:1756
int(* fresolve)(struct soap *, const char *, struct in_addr *inaddr)
Definition: stdsoap2.h:1649
int soap_set_receiver_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
Definition: stdsoap2.cpp:19218
#define SOAP_GAI_STRERROR
Definition: stdsoap2.h:701
int master
Definition: stdsoap2.h:1683
soap_mode omode
Definition: stdsoap2.h:1603
size_t peerlen
Definition: stdsoap2.h:1787
int bind_flags
Definition: stdsoap2.h:1618
int(* fclosesocket)(struct soap *, int)
Definition: stdsoap2.h:1652
const char * soap_int2s(struct soap *soap, int n)
Definition: stdsoap2.cpp:11949
static const char * tcp_error(struct soap *)
Definition: stdsoap2.cpp:4506
struct sockaddr_in peer
Definition: stdsoap2.h:1784
int errnum
Definition: stdsoap2.h:1757
int soap_closesock(struct soap *soap)
Definition: stdsoap2.cpp:6121
#define SOAP_INVALID_SOCKET
Definition: stdsoap2.h:697
#define SOAP_TCP_ERROR
Definition: stdsoap2.h:1023
int socket
Definition: stdsoap2.h:1684
#define SOAP_IO_KEEPALIVE
Definition: stdsoap2.h:1095
size_t soap_block_size ( struct soap ,
struct soap_blist  
)

Definition at line 3120 of file stdsoap2.cpp.

References soap::blist, and soap_blist::ptr.

Referenced by soap_end_send(), and soap_save_block().

3121  {
3122  if (!b)
3123  b = soap->blist;
3124 
3125  return *(size_t*)(b->ptr + sizeof(char*));
3126  }
struct soap_blist * blist
Definition: stdsoap2.h:1624
int soap_body_begin_in ( struct soap )

Definition at line 17685 of file stdsoap2.cpp.

References soap::body, soap::error, soap::part, soap_element_begin_in(), SOAP_IN_BODY, SOAP_NO_BODY, and SOAP_OK.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), and MiriamWebServicesSoapBindingProxy::isDeprecated().

17686  {
17687  soap->part = SOAP_IN_BODY;
17688 
17689  if (soap_element_begin_in(soap, "SOAP-ENV:Body", 0, NULL))
17690  return soap->error;
17691 
17692  if (!soap->body)
17693  soap->part = SOAP_NO_BODY;
17694 
17695  return SOAP_OK;
17696  }
int error
Definition: stdsoap2.h:1755
short part
Definition: stdsoap2.h:1729
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
#define SOAP_NO_BODY
Definition: stdsoap2.h:1158
#define SOAP_IN_BODY
Definition: stdsoap2.h:1159
#define SOAP_OK
Definition: stdsoap2.h:995
short body
Definition: stdsoap2.h:1703
int soap_body_begin_out ( struct soap )

Definition at line 17644 of file stdsoap2.cpp.

References soap::encoding, soap::error, soap::mode, soap::part, soap_element(), soap_element_start_end_out(), SOAP_IN_BODY, soap_set_attr(), SOAP_XML_SEC, and soap::version.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_send_fault().

17645  {
17646  soap->part = SOAP_IN_BODY;
17647 
17648  if (soap->version == 1)
17649  soap->encoding = 1;
17650 
17651 #ifndef WITH_LEAN
17652 
17653  if ((soap->mode & SOAP_XML_SEC) && soap_set_attr(soap, "wsu:Id", "Body"))
17654  return soap->error;
17655 
17656 #endif
17657 
17658  if (soap_element(soap, "SOAP-ENV:Body", 0, NULL))
17659  return soap->error;
17660 
17661  return soap_element_start_end_out(soap, NULL);
17662  }
int soap_element(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9009
int error
Definition: stdsoap2.h:1755
short part
Definition: stdsoap2.h:1729
soap_mode mode
Definition: stdsoap2.h:1601
short version
Definition: stdsoap2.h:1600
int soap_element_start_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9458
#define SOAP_XML_SEC
Definition: stdsoap2.h:1114
short encoding
Definition: stdsoap2.h:1725
#define SOAP_IN_BODY
Definition: stdsoap2.h:1159
int soap_set_attr(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:10035
int soap_body_end_in ( struct soap )

Definition at line 17704 of file stdsoap2.cpp.

References soap::part, soap_element_end_in(), SOAP_END_BODY, SOAP_NO_BODY, and SOAP_OK.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_recv_fault().

17705  {
17706  if (soap->part == SOAP_NO_BODY)
17707  return SOAP_OK;
17708 
17709  soap->part = SOAP_END_BODY;
17710  return soap_element_end_in(soap, "SOAP-ENV:Body");
17711  }
short part
Definition: stdsoap2.h:1729
#define SOAP_NO_BODY
Definition: stdsoap2.h:1158
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
#define SOAP_END_BODY
Definition: stdsoap2.h:1160
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_body_end_out ( struct soap )

Definition at line 17670 of file stdsoap2.cpp.

References soap::error, soap::part, soap_element_end_out(), SOAP_END_BODY, and SOAP_OK.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_send_fault().

17671  {
17672  if (soap_element_end_out(soap, "SOAP-ENV:Body"))
17673  return soap->error;
17674 
17675  soap->part = SOAP_END_BODY;
17676  return SOAP_OK;
17677  }
int error
Definition: stdsoap2.h:1755
short part
Definition: stdsoap2.h:1729
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
#define SOAP_END_BODY
Definition: stdsoap2.h:1160
#define SOAP_OK
Definition: stdsoap2.h:995
const char* soap_byte2s ( struct soap ,
char   
)

Definition at line 12257 of file stdsoap2.cpp.

References soap_long2s().

12258  {
12259  return soap_long2s(soap, (long)n);
12260  }
const char * soap_long2s(struct soap *soap, long n)
Definition: stdsoap2.cpp:12047
int soap_check_mime_attachments ( struct soap soap)

Definition at line 15038 of file stdsoap2.cpp.

References soap::mode, soap_get_mime_attachment(), and SOAP_MIME_POSTCHECK.

15039  {
15040  if (soap->mode & SOAP_MIME_POSTCHECK)
15041  return soap_get_mime_attachment(soap, NULL) != NULL;
15042 
15043  return 0;
15044  }
soap_mode mode
Definition: stdsoap2.h:1601
struct soap_multipart * soap_get_mime_attachment(struct soap *soap, void *handle)
Definition: stdsoap2.cpp:15054
#define SOAP_MIME_POSTCHECK
Definition: stdsoap2.h:1125
void soap_check_result ( struct soap ,
const char *  tag 
)

Definition at line 9787 of file stdsoap2.cpp.

References soap::encodingStyle, soap_instring(), and soap::version.

9788  {
9789  if (soap->version == 2 && soap->encodingStyle)
9790  {
9791  soap_instring(soap, ":result", NULL, NULL, 0, 2, -1, -1);
9792  /* just ignore content for compliance reasons, but should compare tag to element's QName value? */
9793  }
9794  }
short version
Definition: stdsoap2.h:1600
char ** soap_instring(struct soap *soap, const char *tag, char **p, const char *type, int t, int flag, long minlen, long maxlen)
Definition: stdsoap2.cpp:13625
const char * encodingStyle
Definition: stdsoap2.h:1609
void soap_cleanup ( struct soap )

Definition at line 4487 of file stdsoap2.cpp.

References soap_done().

4488  {
4489  soap_done(soap);
4490 #ifdef WIN32
4491 
4492  if (!tcp_done)
4493  return;
4494 
4495  tcp_done = 0;
4496  WSACleanup();
4497 #endif
4498  }
void soap_done(struct soap *soap)
Definition: stdsoap2.cpp:4320
int soap_closesock ( struct soap )

Definition at line 6121 of file stdsoap2.cpp.

References soap::d_stream, soap::error, soap::fclose, soap::keep_alive, SOAP_EOF, SOAP_SSL_ERROR, SOAP_TCP_ERROR, SOAP_ZLIB_DEFLATE, SOAP_ZLIB_INFLATE, SOAP_ZLIB_NONE, and soap::zlib_state.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), soap_accept(), soap_bind(), MiriamWebServicesSoapBindingProxy::soap_close_socket(), soap_done(), soap_end(), soap_recv_empty_response(), soap_recv_fault(), soap_send_empty_response(), soap_send_fault(), and soap_try_connect_command().

6122  {
6123  register int status = soap->error;
6124 
6125  if (status == SOAP_EOF || status == SOAP_TCP_ERROR || status == SOAP_SSL_ERROR || !soap->keep_alive)
6126  {
6127  if (soap->fclose && (soap->error = soap->fclose(soap)))
6128  return soap->error;
6129 
6130  soap->keep_alive = 0;
6131  }
6132 
6133 #ifdef WITH_ZLIB
6134 
6136  deflateEnd(soap->d_stream);
6137  else if (soap->zlib_state == SOAP_ZLIB_INFLATE)
6138  inflateEnd(soap->d_stream);
6139 
6141 #endif
6142  return soap->error = status;
6143  }
short keep_alive
Definition: stdsoap2.h:1742
int error
Definition: stdsoap2.h:1755
#define SOAP_ZLIB_NONE
Definition: stdsoap2.h:1077
#define SOAP_ZLIB_INFLATE
Definition: stdsoap2.h:1079
short zlib_state
Definition: stdsoap2.h:1825
#define SOAP_ZLIB_DEFLATE
Definition: stdsoap2.h:1078
void * d_stream
Definition: stdsoap2.h:1822
#define SOAP_SSL_ERROR
Definition: stdsoap2.h:1025
#define SOAP_TCP_ERROR
Definition: stdsoap2.h:1023
#define SOAP_EOF
Definition: stdsoap2.h:993
int(* fclose)(struct soap *)
Definition: stdsoap2.h:1656
void soap_clr_attr ( struct soap soap)

Definition at line 10164 of file stdsoap2.cpp.

References soap::attributes, soap::mode, soap_attribute::next, SOAP_FREE, SOAP_XML_CANONICAL, soap_attribute::value, and soap_attribute::visible.

Referenced by soap_begin_count(), and soap_begin_send().

10165  {
10166  register struct soap_attribute *tp;
10167 #ifndef WITH_LEAN
10168 
10169  if ((soap->mode & SOAP_XML_CANONICAL))
10170  {
10171  while (soap->attributes)
10172  {
10173  tp = soap->attributes->next;
10174 
10175  if (soap->attributes->value)
10176  SOAP_FREE(soap, soap->attributes->value);
10177 
10178  SOAP_FREE(soap, soap->attributes);
10179  soap->attributes = tp;
10180  }
10181  }
10182  else
10183 #endif
10184 
10185  {
10186  for (tp = soap->attributes; tp; tp = tp->next)
10187  tp->visible = 0;
10188  }
10189  }
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
struct soap_attribute * next
Definition: stdsoap2.h:1337
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
char * value
Definition: stdsoap2.h:1338
void soap_clr_dime ( struct soap )

Definition at line 15457 of file stdsoap2.cpp.

References soap::dime, soap_dime::first, soap_dime::last, soap::omode, and SOAP_ENC_DIME.

15458  {
15459  soap->omode &= ~SOAP_ENC_DIME;
15460  soap->dime.first = NULL;
15461  soap->dime.last = NULL;
15462  }
struct soap_multipart * first
Definition: stdsoap2.h:1397
struct soap_dime dime
Definition: stdsoap2.h:1760
soap_mode omode
Definition: stdsoap2.h:1603
struct soap_multipart * last
Definition: stdsoap2.h:1397
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
void soap_clr_mime ( struct soap )

Definition at line 15472 of file stdsoap2.cpp.

References soap_mime::boundary, soap_mime::first, soap_mime::last, soap::mime, soap::omode, SOAP_ENC_MIME, and soap_mime::start.

Referenced by soap_dealloc().

15473  {
15474  soap->omode &= ~SOAP_ENC_MIME;
15475  soap->mime.first = NULL;
15476  soap->mime.last = NULL;
15477  soap->mime.boundary = NULL;
15478  soap->mime.start = NULL;
15479  }
struct soap_multipart * first
Definition: stdsoap2.h:1413
soap_mode omode
Definition: stdsoap2.h:1603
const char * start
Definition: stdsoap2.h:1411
struct soap_multipart * last
Definition: stdsoap2.h:1413
char * boundary
Definition: stdsoap2.h:1410
struct soap_mime mime
Definition: stdsoap2.h:1761
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
const struct soap_code_map* soap_code ( const struct soap_code_map ,
const char *   
)

Definition at line 1638 of file stdsoap2.cpp.

References soap_code_map::string.

1639  {
1640  if (code_map && str)
1641  {
1642  while (code_map->string)
1643  {
1644  if (!strcmp(str, code_map->string)) /* case sensitive */
1645  return code_map;
1646 
1647  code_map++;
1648  }
1649  }
1650 
1651  return NULL;
1652  }
long soap_code_bits ( const struct soap_code_map ,
const char *   
)

Definition at line 1699 of file stdsoap2.cpp.

References soap_code_map::code, soap_blank, and soap_code_map::string.

1700  {
1701  register long bits = 0;
1702 
1703  if (code_map)
1704  {
1705  while (str && *str)
1706  {
1707  const struct soap_code_map *p;
1708 
1709  for (p = code_map; p->string; p++)
1710  {
1711  register size_t n = strlen(p->string);
1712 
1713  if (!strncmp(p->string, str, n) && soap_blank(str[n]))
1714  {
1715  bits |= p->code;
1716  str += n;
1717 
1718  while (*str > 0 && *str <= 32)
1719  str++;
1720 
1721  break;
1722  }
1723  }
1724 
1725  if (!p->string)
1726  return 0;
1727  }
1728  }
1729 
1730  return bits;
1731  }
const char * string
Definition: stdsoap2.h:1850
#define soap_blank(c)
Definition: stdsoap2.cpp:118
long soap_code_int ( const struct soap_code_map ,
const char *  ,
long   
)

Definition at line 1660 of file stdsoap2.cpp.

References soap_code_map::code, soap_tag_cmp(), and soap_code_map::string.

Referenced by soap_char(), and soap_getmimehdr().

1661  {
1662  if (code_map)
1663  {
1664  while (code_map->string)
1665  {
1666  if (!soap_tag_cmp(str, code_map->string)) /* case insensitive */
1667  return code_map->code;
1668 
1669  code_map++;
1670  }
1671  }
1672 
1673  return other;
1674  }
int soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:3657
const char* soap_code_list ( struct soap ,
const struct soap_code_map ,
long   
)

Definition at line 1739 of file stdsoap2.cpp.

References soap_code_map::code, soap_code_map::string, and soap::tmpbuf.

1740  {
1741  register char *t = soap->tmpbuf;
1742 
1743  if (code_map)
1744  {
1745  while (code_map->string)
1746  {
1747  if (code_map->code & code)
1748  {
1749  register const char *s = code_map->string;
1750 
1751  if (t != soap->tmpbuf)
1752  *t++ = ' ';
1753 
1754  while (*s && t < soap->tmpbuf + sizeof(soap->tmpbuf) - 1)
1755  *t++ = *s++;
1756 
1757  if (t == soap->tmpbuf + sizeof(soap->tmpbuf) - 1)
1758  break;
1759  }
1760 
1761  code_map++;
1762  }
1763  }
1764 
1765  *t = '\0';
1766  return soap->tmpbuf;
1767  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
const char* soap_code_str ( const struct soap_code_map ,
long   
)

Definition at line 1682 of file stdsoap2.cpp.

References soap_code_map::code, and soap_code_map::string.

Referenced by http_error(), soap_count_attachments(), soap_putmimehdr(), and tcp_error().

1683  {
1684  if (!code_map)
1685  return NULL;
1686 
1687  while (code_map->code != code && code_map->string)
1688  code_map++;
1689 
1690  return code_map->string;
1691  }
int soap_connect ( struct soap ,
const char *  ,
const char *   
)

Definition at line 17832 of file stdsoap2.cpp.

References soap_connect_command(), and SOAP_POST.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), and MiriamWebServicesSoapBindingProxy::isDeprecated().

17833  {
17834  return soap_connect_command(soap, SOAP_POST, endpoint, action);
17835  }
#define SOAP_POST
Definition: stdsoap2.h:1063
int soap_connect_command(struct soap *soap, int http_command, const char *endpoints, const char *action)
Definition: stdsoap2.cpp:17843
int soap_connect_command ( struct soap ,
int  ,
const char *  ,
const char *   
)

Definition at line 17843 of file stdsoap2.cpp.

References soap::error, SOAP_FREE, SOAP_MALLOC, SOAP_OK, SOAP_TCP_ERROR, and soap_try_connect_command().

Referenced by soap_connect().

17844  {
17845  char *endpoint;
17846  const char *s;
17847 
17848  if (endpoints && (s = strchr(endpoints, ' ')))
17849  {
17850  endpoint = (char*)SOAP_MALLOC(soap, strlen(endpoints) + 1);
17851 
17852  for (;;)
17853  {
17854  strncpy(endpoint, endpoints, s - endpoints);
17855  endpoint[s - endpoints] = '\0';
17856 
17857  if (soap_try_connect_command(soap, http_command, endpoint, action) != SOAP_TCP_ERROR)
17858  break;
17859 
17860  if (!*s)
17861  break;
17862 
17863  soap->error = SOAP_OK;
17864 
17865  while (*s == ' ')
17866  s++;
17867 
17868  endpoints = s;
17869  s = strchr(endpoints, ' ');
17870 
17871  if (!s)
17872  s = endpoints + strlen(endpoints);
17873  }
17874 
17875  SOAP_FREE(soap, endpoint);
17876  }
17877  else
17878  soap_try_connect_command(soap, http_command, endpoints, action);
17879 
17880  return soap->error;
17881  }
int error
Definition: stdsoap2.h:1755
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
#define SOAP_OK
Definition: stdsoap2.h:995
static int soap_try_connect_command(struct soap *, int http_command, const char *endpoint, const char *action)
Definition: stdsoap2.cpp:17887
#define SOAP_TCP_ERROR
Definition: stdsoap2.h:1023
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
struct soap* soap_copy ( const struct soap )

Definition at line 8266 of file stdsoap2.cpp.

References soap_copy_context().

8267  {
8268  return soap_copy_context((struct soap*)malloc(sizeof(struct soap)), soap);
8269  }
struct soap * soap_copy_context(struct soap *copy, const struct soap *soap)
Definition: stdsoap2.cpp:8277
struct soap* soap_copy_context ( struct soap ,
const struct soap  
)

Definition at line 8277 of file stdsoap2.cpp.

References soap::action, soap::alist, soap::attributes, soap::bio, soap::blist, soap::c_locale, soap::clist, soap::cookies, soap::d_stream, DBGLOG, soap::error, soap::fault, soap_plugin::fcopy, soap::header, soap_plugin::id, soap::labbuf, soap::labidx, soap::lablen, soap::local_namespaces, soap::logfile, soap_plugin::next, soap::nlist, soap::passwd, soap::plugins, soap_check_state, SOAP_COPY, SOAP_FREE, SOAP_INDEX_RECV, SOAP_INDEX_SENT, SOAP_INDEX_TEST, soap_init_iht(), soap_init_logs(), soap_init_pht(), SOAP_MALLOC, SOAP_OK, soap::ssl, soap::state, soap::userid, and soap::z_buf.

Referenced by MiriamWebServicesSoapBindingProxy::MiriamWebServicesSoapBindingProxy(), and soap_copy().

8278  {
8279  if (soap_check_state(soap))
8280  return NULL;
8281 
8282  if (copy)
8283  {
8284  register struct soap_plugin *p = NULL;
8285 #ifdef __cplusplus
8286  *copy = *soap;
8287 #else
8288  memcpy(copy, soap, sizeof(struct soap));
8289 #endif
8290  copy->state = SOAP_COPY;
8291  copy->error = SOAP_OK;
8292  copy->userid = NULL;
8293  copy->passwd = NULL;
8294  copy->nlist = NULL;
8295  copy->blist = NULL;
8296  copy->clist = NULL;
8297  copy->alist = NULL;
8298  copy->attributes = NULL;
8299  copy->labbuf = NULL;
8300  copy->lablen = 0;
8301  copy->labidx = 0;
8302 #ifdef SOAP_MEM_DEBUG
8303  soap_init_mht(copy);
8304 #endif
8305 #if !defined(WITH_LEAN) || defined(SOAP_DEBUG)
8306  soap_init_logs(copy);
8307 #endif
8308 #ifdef SOAP_DEBUG
8309  soap_set_test_logfile(copy, soap->logfile[SOAP_INDEX_TEST]);
8310  soap_set_sent_logfile(copy, soap->logfile[SOAP_INDEX_SENT]);
8311  soap_set_recv_logfile(copy, soap->logfile[SOAP_INDEX_RECV]);
8312 #endif
8313 #ifdef WITH_C_LOCALE
8314  copy->c_locale = duplocale(soap->c_locale);
8315 #else
8316  copy->c_locale = NULL;
8317 #endif
8318 #ifdef WITH_OPENSSL
8319  copy->bio = NULL;
8320  copy->ssl = NULL;
8321 #endif
8322 #ifdef WITH_ZLIB
8323  copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream));
8324  copy->d_stream->zalloc = Z_NULL;
8325  copy->d_stream->zfree = Z_NULL;
8326  copy->d_stream->opaque = Z_NULL;
8327  copy->z_buf = NULL;
8328 #endif
8329  copy->local_namespaces = NULL;
8330 #ifndef WITH_NOIDREF
8331  soap_init_iht(copy);
8332  soap_init_pht(copy);
8333 #endif
8334  copy->header = NULL;
8335  copy->fault = NULL;
8336  copy->action = NULL;
8337 #ifndef WITH_LEAN
8338 #ifdef WITH_COOKIES
8339  copy->cookies = soap_copy_cookies(copy, soap);
8340 #else
8341  copy->cookies = NULL;
8342 #endif
8343 #endif
8344  copy->plugins = NULL;
8345 
8346  for (p = soap->plugins; p; p = p->next)
8347  {
8348  register struct soap_plugin * q = (struct soap_plugin*)SOAP_MALLOC(copy, sizeof(struct soap_plugin));
8349 
8350  if (!q)
8351  return NULL;
8352 
8353  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying plugin '%s'\n", p->id));
8354  *q = *p;
8355 
8356  if (p->fcopy && p->fcopy(copy, q, p))
8357  {
8358  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not copy plugin '%s'\n", p->id));
8359  SOAP_FREE(copy, q);
8360  return NULL;
8361  }
8362 
8363  q->next = copy->plugins;
8364  copy->plugins = q;
8365  }
8366  }
8367 
8368  return copy;
8369  }
static void soap_init_logs(struct soap *)
Definition: stdsoap2.cpp:8154
struct soap_plugin * plugins
Definition: stdsoap2.h:1635
static void soap_init_iht(struct soap *)
Definition: stdsoap2.cpp:6989
static void soap_init_pht(struct soap *)
Definition: stdsoap2.cpp:6168
struct soap_plugin * next
Definition: stdsoap2.h:1880
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
const char * id
Definition: stdsoap2.h:1881
int(* fcopy)(struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src)
Definition: stdsoap2.h:1883
#define SOAP_INDEX_SENT
Definition: stdsoap2.h:871
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
void * c_locale
Definition: stdsoap2.h:1816
const char * logfile[(3)]
Definition: stdsoap2.h:1765
#define soap_check_state(soap)
Definition: stdsoap2.h:1150
#define SOAP_COPY
Definition: stdsoap2.h:1148
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_INDEX_RECV
Definition: stdsoap2.h:870
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
#define SOAP_INDEX_TEST
Definition: stdsoap2.h:872
void soap_copy_stream ( struct soap ,
struct soap  
)

Definition at line 8377 of file stdsoap2.cpp.

References soap::ahead, soap::bio, soap::buf, soap::bufidx, soap::buflen, soap::cdata, soap::chunkbuflen, soap::chunksize, soap::ctx, soap::d_stream, soap::imode, soap::is, soap::keep_alive, soap::max_keep_alive, soap::mode, soap::omode, soap::os, soap::peer, soap::peerlen, soap::recv_timeout, soap::recvfd, soap::send_timeout, soap::sendfd, SOAP_BUFLEN, SOAP_MALLOC, SOAP_ZLIB_NONE, soap::socket, soap::ssl, soap::tcp_keep_alive, soap::tcp_keep_cnt, soap::tcp_keep_idle, soap::tcp_keep_intvl, soap::z_buf, soap::z_buflen, soap::z_crc, soap::z_level, soap::z_ratio_in, soap::z_ratio_out, soap::zlib_in, soap::zlib_out, and soap::zlib_state.

8378  {
8379  copy->mode = soap->mode;
8380  copy->imode = soap->imode;
8381  copy->omode = soap->omode;
8382  copy->socket = soap->socket;
8383  copy->recv_timeout = soap->recv_timeout;
8384  copy->send_timeout = soap->send_timeout;
8385 #if defined(__cplusplus) && !defined(WITH_LEAN)
8386  copy->os = soap->os;
8387  copy->is = soap->is;
8388 #endif
8389  copy->sendfd = soap->sendfd;
8390  copy->recvfd = soap->recvfd;
8391  copy->bufidx = soap->bufidx;
8392  copy->buflen = soap->buflen;
8393  copy->ahead = soap->ahead;
8394  copy->cdata = soap->cdata;
8395  copy->chunksize = soap->chunksize;
8396  copy->chunkbuflen = soap->chunkbuflen;
8397  copy->keep_alive = soap->keep_alive;
8398  copy->tcp_keep_alive = soap->tcp_keep_alive;
8399  copy->tcp_keep_idle = soap->tcp_keep_idle;
8400  copy->tcp_keep_intvl = soap->tcp_keep_intvl;
8401  copy->tcp_keep_cnt = soap->tcp_keep_cnt;
8402  copy->max_keep_alive = soap->max_keep_alive;
8403 #ifndef WITH_NOIO
8404  copy->peer = soap->peer;
8405  copy->peerlen = soap->peerlen;
8406 #endif
8407 #ifdef WITH_OPENSSL
8408  copy->bio = soap->bio;
8409  copy->ssl = soap->ssl;
8410  copy->ctx = soap->ctx;
8411 #endif
8412 #ifdef WITH_ZLIB
8413  copy->zlib_state = soap->zlib_state;
8414  copy->zlib_in = soap->zlib_in;
8415  copy->zlib_out = soap->zlib_out;
8416  copy->d_stream = (z_stream*)SOAP_MALLOC(copy, sizeof(z_stream));
8417  memcpy(copy->d_stream, soap->d_stream, sizeof(z_stream));
8418  copy->z_crc = soap->z_crc;
8419  copy->z_ratio_in = soap->z_ratio_in;
8420  copy->z_ratio_out = soap->z_ratio_out;
8421  copy->z_buf = NULL;
8422  copy->z_buflen = soap->z_buflen;
8423  copy->z_level = soap->z_level;
8424 
8425  if (soap->z_buf && soap->zlib_state != SOAP_ZLIB_NONE)
8426  {
8427  copy->z_buf = (char*)SOAP_MALLOC(copy, SOAP_BUFLEN);
8428  memcpy(copy->z_buf, soap->z_buf, sizeof(soap->z_buf));
8429  }
8430 
8431 #endif
8432  memcpy(copy->buf, soap->buf, sizeof(soap->buf));
8433  }
short keep_alive
Definition: stdsoap2.h:1742
void * is
Definition: stdsoap2.h:1690
int recvfd
Definition: stdsoap2.h:1694
unsigned short z_level
Definition: stdsoap2.h:1830
unsigned int tcp_keep_idle
Definition: stdsoap2.h:1744
int sendfd
Definition: stdsoap2.h:1693
soap_mode imode
Definition: stdsoap2.h:1602
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
size_t chunksize
Definition: stdsoap2.h:1732
#define SOAP_ZLIB_NONE
Definition: stdsoap2.h:1077
int32_t z_crc
Definition: stdsoap2.h:1823
size_t z_buflen
Definition: stdsoap2.h:1829
short zlib_state
Definition: stdsoap2.h:1825
soap_wchar ahead
Definition: stdsoap2.h:1701
void * bio
Definition: stdsoap2.h:1798
void * d_stream
Definition: stdsoap2.h:1822
char buf[(65536)]
Definition: stdsoap2.h:1710
float z_ratio_out
Definition: stdsoap2.h:1832
soap_mode omode
Definition: stdsoap2.h:1603
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
void * ssl
Definition: stdsoap2.h:1799
int send_timeout
Definition: stdsoap2.h:1613
size_t peerlen
Definition: stdsoap2.h:1787
short cdata
Definition: stdsoap2.h:1702
struct sockaddr_in peer
Definition: stdsoap2.h:1784
float z_ratio_in
Definition: stdsoap2.h:1831
size_t bufidx
Definition: stdsoap2.h:1699
int recv_timeout
Definition: stdsoap2.h:1612
void * ctx
Definition: stdsoap2.h:1800
void * os
Definition: stdsoap2.h:1689
unsigned int max_keep_alive
Definition: stdsoap2.h:1747
short zlib_in
Definition: stdsoap2.h:1826
char * z_buf
Definition: stdsoap2.h:1828
short tcp_keep_alive
Definition: stdsoap2.h:1743
size_t chunkbuflen
Definition: stdsoap2.h:1733
int socket
Definition: stdsoap2.h:1684
unsigned int tcp_keep_cnt
Definition: stdsoap2.h:1746
unsigned int tcp_keep_intvl
Definition: stdsoap2.h:1745
size_t buflen
Definition: stdsoap2.h:1700
short zlib_out
Definition: stdsoap2.h:1827
const char* soap_current_namespace ( struct soap soap,
const char *  tag 
)

Definition at line 3615 of file stdsoap2.cpp.

References soap::error, soap_nlist::id, soap_nlist::index, soap::namespaces, soap_nlist::next, soap::nlist, Namespace::ns, soap_nlist::ns, SOAP_NAMESPACE, and soap_strdup().

Referenced by soap_peek_element().

3616  {
3617  register struct soap_nlist *np;
3618  register const char *s;
3619 
3620  if (!tag || !strncmp(tag, "xml", 3))
3621  return NULL;
3622 
3623  np = soap->nlist;
3624 
3625  if (!(s = strchr(tag, ':')))
3626  {
3627  while (np && *np->id) /* find default namespace, if present */
3628  np = np->next;
3629  }
3630  else
3631  {
3632  while (np && (strncmp(np->id, tag, s - tag) || np->id[s - tag]))
3633  np = np->next;
3634 
3635  if (!np)
3636  soap->error = SOAP_NAMESPACE;
3637  }
3638 
3639  if (np)
3640  {
3641  if (np->index >= 0)
3642  return soap->namespaces[np->index].ns;
3643 
3644  if (np->ns)
3645  return soap_strdup(soap, np->ns);
3646  }
3647 
3648  return NULL;
3649  }
int error
Definition: stdsoap2.h:1755
const struct Namespace * namespaces
Definition: stdsoap2.h:1621
char id[1]
Definition: stdsoap2.h:1275
char * ns
Definition: stdsoap2.h:1274
short index
Definition: stdsoap2.h:1273
const char * ns
Definition: stdsoap2.h:1263
struct soap_nlist * next
Definition: stdsoap2.h:1271
#define SOAP_NAMESPACE
Definition: stdsoap2.h:1004
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
const char* soap_dateTime2s ( struct soap ,
time_t   
)

Definition at line 13795 of file stdsoap2.cpp.

References abs, and soap::tmpbuf.

Referenced by soap_outdateTime().

13796  {
13797  struct tm T, *pT = &T;
13798 #if defined(HAVE_GMTIME_R)
13799 
13800  if (gmtime_r(&n, pT))
13801  strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
13802 
13803 #elif defined(HAVE_GMTIME)
13804 
13805  if ((pT = gmtime(&n)))
13806  strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
13807 
13808 #elif defined(HAVE_GETTIMEOFDAY)
13809  struct timezone tz;
13810  memset((void*)&tz, 0, sizeof(tz));
13811 #if defined(HAVE_LOCALTIME_R)
13812 
13813  if (localtime_r(&n, pT))
13814  {
13815  struct timeval tv;
13816  gettimeofday(&tv, &tz);
13817  strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
13818  sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -tz.tz_minuteswest / 60 + (pT->tm_isdst != 0), abs(tz.tz_minuteswest) % 60);
13819  }
13820 
13821 #else
13822 
13823  if ((pT = localtime(&n)))
13824  {
13825  struct timeval tv;
13826  gettimeofday(&tv, &tz);
13827  strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
13828  sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -tz.tz_minuteswest / 60 + (pT->tm_isdst != 0), abs(tz.tz_minuteswest) % 60);
13829  }
13830 
13831 #endif
13832 #elif defined(HAVE_FTIME)
13833  struct timeb t;
13834  memset((void*)&t, 0, sizeof(t));
13835 #if defined(HAVE_LOCALTIME_R)
13836 
13837  if (localtime_r(&n, pT))
13838  {
13839 #ifdef __BORLANDC__
13840  ::ftime(&t);
13841 #else
13842  ftime(&t);
13843 #endif
13844  strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
13845  sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -t.timezone / 60 + (pT->tm_isdst != 0), abs(t.timezone) % 60);
13846  }
13847 
13848 #else
13849 
13850  if ((pT = localtime(&n)))
13851  {
13852 #ifdef __BORLANDC__
13853  ::ftime(&t);
13854 #else
13855  ftime(&t);
13856 #endif
13857  strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
13858  sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -t.timezone / 60 + (pT->tm_isdst != 0), abs(t.timezone) % 60);
13859  }
13860 
13861 #endif
13862 #elif defined(HAVE_LOCALTIME_R)
13863 
13864  if (localtime_r(&n, pT))
13865  strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
13866 
13867 #else
13868 
13869  if ((pT = localtime(&n)))
13870  strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
13871 
13872 #endif
13873  else
13874  strcpy(soap->tmpbuf, "1969-12-31T23:59:59Z");
13875 
13876  return soap->tmpbuf;
13877  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
#define abs(x)
Definition: f2c.h:173
void soap_dealloc ( struct soap ,
void  
)

Definition at line 7236 of file stdsoap2.cpp.

References soap::action, soap::alist, soap::authrealm, DBGHEX, DBGLOG, soap::error, soap::fault, soap::header, soap::http_content, if(), soap::passwd, SOAP_CANARY, soap_check_state, soap_clr_mime(), soap_delete(), SOAP_FREE, SOAP_MOE, and soap::userid.

Referenced by soap_end().

7237  {
7238  if (soap_check_state(soap))
7239  return;
7240 
7241  if (p)
7242  {
7243  register char **q;
7244 
7245  for (q = (char**) & soap->alist; *q; q = *(char***)q)
7246  {
7247  if (*(short*)(char*)(*q - sizeof(short)) != (short)SOAP_CANARY)
7248  {
7249 #ifdef SOAP_MEM_DEBUG
7250  fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n");
7251 #endif
7252  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n"));
7253  DBGHEX(TEST, *q - 200, 200);
7254  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n"));
7255  soap->error = SOAP_MOE;
7256  return;
7257  }
7258 
7259  if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*))))
7260  {
7261  *q = **(char***)q;
7262  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Freed data at %p\n", p));
7263  SOAP_FREE(soap, p);
7264  return;
7265  }
7266  }
7267 
7268  soap_delete(soap, p);
7269  }
7270  else
7271  {
7272  register char *q;
7273  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free all soap_malloc() data\n"));
7274 
7275  while (soap->alist)
7276  {
7277  q = (char*)soap->alist;
7278 
7279  if (*(short*)(char*)(q - sizeof(short)) != (short)SOAP_CANARY)
7280  {
7281 #ifdef SOAP_MEM_DEBUG
7282  fprintf(stderr, "Data corruption in dynamic allocation (see logs)\n");
7283 #endif
7284  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Data corruption:\n"));
7285  DBGHEX(TEST, q - 200, 200);
7286  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\n"));
7287  soap->error = SOAP_MOE;
7288  return;
7289  }
7290 
7291  soap->alist = *(void**)q;
7292  q -= *(size_t*)(q + sizeof(void*));
7293  SOAP_FREE(soap, q);
7294  }
7295 
7296  /* we must assume these were deallocated: */
7297  soap->action = NULL;
7298  soap->fault = NULL;
7299  soap->header = NULL;
7300  soap->userid = NULL;
7301  soap->passwd = NULL;
7302  soap->authrealm = NULL;
7303  soap->http_content = NULL;
7304 #ifndef WITH_LEANER
7306 #endif
7307  }
7308  }
#define SOAP_MOE
Definition: stdsoap2.h:1016
int error
Definition: stdsoap2.h:1755
char * action
Definition: stdsoap2.h:1737
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define DBGHEX(DBGFILE, MSG, LEN)
Definition: stdsoap2.h:1253
char * authrealm
Definition: stdsoap2.h:1738
const char * http_content
Definition: stdsoap2.h:1608
void soap_clr_mime(struct soap *soap)
Definition: stdsoap2.cpp:15472
void * alist
Definition: stdsoap2.h:1626
#define SOAP_CANARY
Definition: stdsoap2.cpp:305
struct SOAP_ENV__Header * header
Definition: stdsoap2.h:1631
#define soap_check_state(soap)
Definition: stdsoap2.h:1150
void soap_delete(struct soap *soap, void *p)
Definition: stdsoap2.cpp:7316
char * userid
Definition: stdsoap2.h:1636
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
if(!yymsg) yymsg
char * passwd
Definition: stdsoap2.h:1637
const char* soap_decode_key ( char *  ,
size_t  ,
const char *   
)

Definition at line 17330 of file stdsoap2.cpp.

References soap_decode().

Referenced by soap_get_header_attribute().

17331  {
17332  return soap_decode(buf, len, val, "=,;");
17333  }
static const char * soap_decode(char *, size_t, const char *, const char *)
Definition: stdsoap2.cpp:17360
const char* soap_decode_val ( char *  ,
size_t  ,
const char *   
)

Definition at line 17343 of file stdsoap2.cpp.

References soap_decode().

Referenced by soap_get_header_attribute().

17344  {
17345  if (*val != '=')
17346  {
17347  *buf = '\0';
17348  return val;
17349  }
17350 
17351  return soap_decode(buf, len, val + 1, ",;");
17352  }
static const char * soap_decode(char *, size_t, const char *, const char *)
Definition: stdsoap2.cpp:17360
void soap_del ( struct soap )

Definition at line 6236 of file stdsoap2.cpp.

6237  {
6238  free(soap);
6239  }
void soap_delete ( struct soap ,
void  
)

Definition at line 7316 of file stdsoap2.cpp.

References soap::clist, DBGLOG, soap::fault, soap_clist::fdelete, soap::header, soap_clist::next, soap_clist::ptr, soap_check_state, SOAP_FREE, and soap_clist::type.

Referenced by soap_dealloc(), soap_delete_ArrayOf_USCORExsd_USCOREstring(), soap_delete_ns2__checkRegExp(), soap_delete_ns2__checkRegExpResponse(), soap_delete_ns2__getDataResources(), soap_delete_ns2__getDataResourcesResponse(), soap_delete_ns2__getDataTypeDef(), soap_delete_ns2__getDataTypeDefResponse(), soap_delete_ns2__getDataTypePattern(), soap_delete_ns2__getDataTypePatternResponse(), soap_delete_ns2__getDataTypesId(), soap_delete_ns2__getDataTypesIdResponse(), soap_delete_ns2__getDataTypesName(), soap_delete_ns2__getDataTypesNameResponse(), soap_delete_ns2__getDataTypeSynonyms(), soap_delete_ns2__getDataTypeSynonymsResponse(), soap_delete_ns2__getDataTypeURI(), soap_delete_ns2__getDataTypeURIResponse(), soap_delete_ns2__getDataTypeURIs(), soap_delete_ns2__getDataTypeURIsResponse(), soap_delete_ns2__getJavaLibraryVersion(), soap_delete_ns2__getJavaLibraryVersionResponse(), soap_delete_ns2__getLocation(), soap_delete_ns2__getLocationResponse(), soap_delete_ns2__getLocations(), soap_delete_ns2__getLocations_(), soap_delete_ns2__getLocationsResponse(), soap_delete_ns2__getLocationsResponse_(), soap_delete_ns2__getMiriamURI(), soap_delete_ns2__getMiriamURIResponse(), soap_delete_ns2__getName(), soap_delete_ns2__getNameResponse(), soap_delete_ns2__getNames(), soap_delete_ns2__getNamesResponse(), soap_delete_ns2__getOfficialDataTypeURI(), soap_delete_ns2__getOfficialDataTypeURIResponse(), soap_delete_ns2__getResourceInfo(), soap_delete_ns2__getResourceInfoResponse(), soap_delete_ns2__getResourceInstitution(), soap_delete_ns2__getResourceInstitutionResponse(), soap_delete_ns2__getResourceLocation(), soap_delete_ns2__getResourceLocationResponse(), soap_delete_ns2__getServicesInfo(), soap_delete_ns2__getServicesInfoResponse(), soap_delete_ns2__getServicesVersion(), soap_delete_ns2__getServicesVersionResponse(), soap_delete_ns2__getURI(), soap_delete_ns2__getURIResponse(), soap_delete_ns2__isDeprecated(), soap_delete_ns2__isDeprecatedResponse(), soap_delete_SOAP_ENV__Code(), soap_delete_SOAP_ENV__Detail(), soap_delete_SOAP_ENV__Fault(), soap_delete_SOAP_ENV__Header(), soap_delete_SOAP_ENV__Reason(), and soap_delete_std__string().

7317  {
7318  register struct soap_clist **cp;
7319 
7320  if (soap_check_state(soap))
7321  return;
7322 
7323  cp = &soap->clist;
7324 
7325  if (p)
7326  {
7327  while (*cp)
7328  {
7329  if (p == (*cp)->ptr)
7330  {
7331  register struct soap_clist *q = *cp;
7332  *cp = q->next;
7333 
7334  if (q->fdelete(q))
7335  {
7336  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: deletion callback failed for object type %d\n", q->ptr, q->type));
7337 #ifdef SOAP_MEM_DEBUG
7338  fprintf(stderr, "new(object type = %d) = %p not freed: deletion callback failed\n", q->type, q->ptr);
7339 #endif
7340  }
7341 
7342  SOAP_FREE(soap, q);
7343  return;
7344  }
7345 
7346  cp = &(*cp)->next;
7347  }
7348 
7349  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: address not in list\n", p));
7350  }
7351  else
7352  {
7353  while (*cp)
7354  {
7355  register struct soap_clist *q = *cp;
7356  *cp = q->next;
7357 
7358  if (q->fdelete(q))
7359  {
7360  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: deletion callback failed for object type %d\n", q->ptr, q->type));
7361 #ifdef SOAP_MEM_DEBUG
7362  fprintf(stderr, "new(object type = %d) = %p not freed: deletion callback failed\n", q->type, q->ptr);
7363 #endif
7364  }
7365 
7366  SOAP_FREE(soap, q);
7367  }
7368  }
7369 
7370  soap->fault = NULL; /* this was possibly deallocated */
7371  soap->header = NULL; /* this was possibly deallocated */
7372  }
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_clist * clist
Definition: stdsoap2.h:1625
int(* fdelete)(struct soap_clist *)
Definition: stdsoap2.h:1331
struct SOAP_ENV__Header * header
Definition: stdsoap2.h:1631
#define soap_check_state(soap)
Definition: stdsoap2.h:1150
void * ptr
Definition: stdsoap2.h:1328
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
struct soap_clist * next
Definition: stdsoap2.h:1327
int soap_dime_forward ( struct soap ,
unsigned char **  ,
int *  ,
char **  ,
char **  ,
char **   
)

Definition at line 2653 of file stdsoap2.cpp.

References soap::error, soap::href, soap_xlist::id, soap_xlist::next, soap_xlist::options, soap_xlist::ptr, soap_xlist::size, SOAP_EOM, SOAP_MALLOC, SOAP_OK, soap_strdup(), soap_xlist::type, and soap::xlist.

Referenced by soap_xop_forward().

2654  {
2655  struct soap_xlist *xp;
2656  *ptr = NULL;
2657  *size = 0;
2658  *id = NULL;
2659  *type = NULL;
2660  *options = NULL;
2661 
2662  if (!*soap->href)
2663  return SOAP_OK;
2664 
2665  *id = soap_strdup(soap, soap->href);
2666  xp = (struct soap_xlist*)SOAP_MALLOC(soap, sizeof(struct soap_xlist));
2667 
2668  if (!xp)
2669  return soap->error = SOAP_EOM;
2670 
2671  xp->next = soap->xlist;
2672  xp->ptr = ptr;
2673  xp->size = size;
2674  xp->id = *id;
2675  xp->type = type;
2676  xp->options = options;
2677  soap->xlist = xp;
2678  return SOAP_OK;
2679  }
int * size
Definition: stdsoap2.h:1462
int error
Definition: stdsoap2.h:1755
char * id
Definition: stdsoap2.h:1463
char href[(1024)]
Definition: stdsoap2.h:1715
unsigned char ** ptr
Definition: stdsoap2.h:1461
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
char ** options
Definition: stdsoap2.h:1465
#define SOAP_OK
Definition: stdsoap2.h:995
struct soap_xlist * next
Definition: stdsoap2.h:1460
struct soap_xlist * xlist
Definition: stdsoap2.h:1762
#define SOAP_EOM
Definition: stdsoap2.h:1015
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
char ** type
Definition: stdsoap2.h:1464
char* soap_dime_option ( struct soap ,
unsigned  short,
const char *   
)

Definition at line 14436 of file stdsoap2.cpp.

References soap_malloc().

Referenced by soap_set_dime_attachment().

14437  {
14438  size_t n;
14439  char *s = NULL;
14440 
14441  if (option)
14442  {
14443  n = strlen(option);
14444  s = (char*)soap_malloc(soap, n + 5);
14445 
14446  if (s)
14447  {
14448  s[0] = (char)(optype >> 8);
14449  s[1] = (char)(optype & 0xFF);
14450  s[2] = (char)(n >> 8);
14451  s[3] = (char)(n & 0xFF);
14452  strcpy(s + 4, option);
14453  }
14454  }
14455 
14456  return s;
14457  }
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
struct soap_dom_attribute* soap_dom_next_attribute ( struct soap_dom_attribute att)
struct soap_dom_element* soap_dom_next_element ( struct soap_dom_element elt)
void soap_done ( struct soap )

Definition at line 4320 of file stdsoap2.cpp.

References soap::c_locale, soap::clist, soap::ctx, soap::d_stream, DBGLOG, soap::faccept, soap::fclose, soap::fclosesocket, soap_plugin::fcopy, soap::fdel, soap_plugin::fdelete, soap::fform, soap::fget, soap::fhead, soap::fheader, soap::fignore, soap::fmalloc, soap::fopen, soap::fparse, soap::fparsehdr, fplugin(), soap::fplugin, soap::fpoll, soap::fpost, soap::fposthdr, soap::fpreparefinal, soap::fprepareinit, soap::fpreparerecv, soap::fpreparesend, soap::fput, frecv(), soap::frecv, soap::fresolve, soap::fresponse, fsend(), soap::fsend, soap::fserveloop, soap::fseterror, soap::fshutdownsocket, http_del(), http_get(), http_head(), http_parse(), http_parse_header(), http_post(), http_post_header(), http_put(), http_response(), soap_plugin::id, soap::keep_alive, soap::logfile, soap::master, soap_clist::next, soap_plugin::next, soap::omode, soap::plugins, soap::session, soap_check_state, soap_closesock(), SOAP_FREE, soap_free_temp(), SOAP_INIT, SOAP_INVALID_SOCKET, SOAP_IO_UDP, SOAP_MAXLOGS, SOAP_NONE, soap_poll(), soap_valid_socket, soap::ssl, soap::state, tcp_accept(), tcp_closesocket(), tcp_connect(), tcp_disconnect(), tcp_gethost(), tcp_shutdownsocket(), and soap::z_buf.

Referenced by soap_cleanup(), and soap_free().

4321  {
4322 #ifdef SOAP_DEBUG
4323  int i;
4324 #endif
4325 
4326  if (soap_check_state(soap))
4327  return;
4328 
4329  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Done with context\n"));
4331 
4332  while (soap->clist)
4333  {
4334  struct soap_clist *p = soap->clist->next;
4335  SOAP_FREE(soap, soap->clist);
4336  soap->clist = p;
4337  }
4338 
4339  soap->omode &= ~SOAP_IO_UDP; /* to force close the socket */
4340  soap->keep_alive = 0; /* to force close the socket */
4342 #ifdef WITH_COOKIES
4343  soap_free_cookies(soap);
4344 #endif
4345 
4346  while (soap->plugins)
4347  {
4348  register struct soap_plugin *p = soap->plugins->next;
4349  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Removing plugin '%s'\n", soap->plugins->id));
4350 
4351  if (soap->plugins->fcopy || soap->state == SOAP_INIT)
4353 
4355  soap->plugins = p;
4356  }
4357 
4358  soap->fplugin = fplugin;
4359  soap->fmalloc = NULL;
4360 #ifndef WITH_NOHTTP
4361  soap->fpost = http_post;
4362  soap->fget = http_get;
4363  soap->fput = http_put;
4364  soap->fdel = http_del;
4365  soap->fhead = http_head;
4366  soap->fform = NULL;
4369  soap->fparse = http_parse;
4371 #endif
4372  soap->fheader = NULL;
4373 #ifndef WITH_NOIO
4374 #ifndef WITH_IPV6
4376 #else
4377  soap->fresolve = NULL;
4378 #endif
4379  soap->faccept = tcp_accept;
4380  soap->fopen = tcp_connect;
4384  soap->fsend = fsend;
4385  soap->frecv = frecv;
4386  soap->fpoll = soap_poll;
4387 #else
4388  soap->fopen = NULL;
4389  soap->fclose = NULL;
4390  soap->fpoll = NULL;
4391 #endif
4392 #ifndef WITH_LEANER
4393  soap->fprepareinit = NULL;
4394  soap->fpreparesend = NULL;
4395  soap->fpreparerecv = NULL;
4396  soap->fpreparefinal = NULL;
4397 #endif
4398  soap->fseterror = NULL;
4399  soap->fignore = NULL;
4400  soap->fserveloop = NULL;
4401 #ifdef WITH_OPENSSL
4402 
4403  if (soap->session)
4404  {
4405  SSL_SESSION_free(soap->session);
4406  soap->session = NULL;
4407  }
4408 
4409 #endif
4410 
4411  if (soap->state == SOAP_INIT)
4412  {
4414  {
4417  }
4418  }
4419 
4420 #ifdef WITH_OPENSSL
4421 
4422  if (soap->ssl)
4423  {
4424  SSL_free(soap->ssl);
4425  soap->ssl = NULL;
4426  }
4427 
4428  if (soap->state == SOAP_INIT)
4429  {
4430  if (soap->ctx)
4431  {
4432  SSL_CTX_free(soap->ctx);
4433  soap->ctx = NULL;
4434  }
4435  }
4436 
4437 #endif
4438 #ifdef WITH_OPENSSL
4439  ERR_remove_state(0);
4440 #endif
4441 #ifdef WITH_C_LOCALE
4442  freelocale(soap->c_locale);
4443 #endif
4444 #ifdef WITH_ZLIB
4445 
4446  if (soap->d_stream)
4447  {
4448  SOAP_FREE(soap, (void*)soap->d_stream);
4449  soap->d_stream = NULL;
4450  }
4451 
4452  if (soap->z_buf)
4453  {
4454  SOAP_FREE(soap, (void*)soap->z_buf);
4455  soap->z_buf = NULL;
4456  }
4457 
4458 #endif
4459 #ifdef SOAP_DEBUG
4460  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free logfiles\n"));
4461 
4462  for (i = 0; i < SOAP_MAXLOGS; i++)
4463  {
4464  if (soap->logfile[i])
4465  {
4466  SOAP_FREE(soap, (void*)soap->logfile[i]);
4467  soap->logfile[i] = NULL;
4468  }
4469 
4470  soap_close_logfile(soap, i);
4471  }
4472 
4473  soap->state = SOAP_NONE;
4474 #endif
4475 #ifdef SOAP_MEM_DEBUG
4476  soap_free_mht(soap);
4477 #endif
4478  }
int(* fheader)(struct soap *)
Definition: stdsoap2.h:1648
size_t(* frecv)(struct soap *, char *, size_t)
Definition: stdsoap2.h:1658
short keep_alive
Definition: stdsoap2.h:1742
void *(* fplugin)(struct soap *, const char *)
Definition: stdsoap2.h:1663
struct soap_plugin * plugins
Definition: stdsoap2.h:1635
#define soap_valid_socket(n)
Definition: stdsoap2.h:698
static int http_post_header(struct soap *, const char *, const char *)
Definition: stdsoap2.cpp:18535
int(* faccept)(struct soap *, int, struct sockaddr *, int *n)
Definition: stdsoap2.h:1655
void soap_free_temp(struct soap *soap)
Definition: stdsoap2.cpp:8060
int(* fpost)(struct soap *, const char *, const char *, int, const char *, const char *, size_t)
Definition: stdsoap2.h:1638
int(* fserveloop)(struct soap *)
Definition: stdsoap2.h:1662
static int http_response(struct soap *, int, size_t)
Definition: stdsoap2.cpp:18555
static int http_head(struct soap *)
Definition: stdsoap2.cpp:18383
static int tcp_gethost(struct soap *, const char *addr, struct in_addr *inaddr)
Definition: stdsoap2.cpp:4560
#define SOAP_INIT
Definition: stdsoap2.h:1147
int(* fhead)(struct soap *)
Definition: stdsoap2.h:1642
struct soap_plugin * next
Definition: stdsoap2.h:1880
#define SOAP_IO_UDP
Definition: stdsoap2.h:1092
static int http_del(struct soap *)
Definition: stdsoap2.cpp:18372
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
const char * id
Definition: stdsoap2.h:1881
int(* fcopy)(struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src)
Definition: stdsoap2.h:1883
struct soap_clist * clist
Definition: stdsoap2.h:1625
int(* fpoll)(struct soap *)
Definition: stdsoap2.h:1659
int(* fform)(struct soap *)
Definition: stdsoap2.h:1643
static int tcp_closesocket(struct soap *, int)
Definition: stdsoap2.cpp:6096
static int http_put(struct soap *)
Definition: stdsoap2.cpp:18361
int soap_poll(struct soap *soap)
Definition: stdsoap2.cpp:5673
int(* fresolve)(struct soap *, const char *, struct in_addr *inaddr)
Definition: stdsoap2.h:1649
static int http_parse_header(struct soap *, const char *, const char *)
Definition: stdsoap2.cpp:17127
static int http_get(struct soap *)
Definition: stdsoap2.cpp:18350
void * d_stream
Definition: stdsoap2.h:1822
int(* fdel)(struct soap *)
Definition: stdsoap2.h:1641
int master
Definition: stdsoap2.h:1683
int(* fshutdownsocket)(struct soap *, int, int)
Definition: stdsoap2.h:1653
#define SOAP_NONE
Definition: stdsoap2.h:1146
int(* fpreparesend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1667
soap_mode omode
Definition: stdsoap2.h:1603
int(* fposthdr)(struct soap *, const char *, const char *)
Definition: stdsoap2.h:1644
int(* fpreparefinal)(struct soap *)
Definition: stdsoap2.h:1669
void * ssl
Definition: stdsoap2.h:1799
void * c_locale
Definition: stdsoap2.h:1816
int(* fclosesocket)(struct soap *, int)
Definition: stdsoap2.h:1652
const char * logfile[(3)]
Definition: stdsoap2.h:1765
static size_t frecv(struct soap *, char *, size_t)
Definition: stdsoap2.cpp:1005
int(* fput)(struct soap *)
Definition: stdsoap2.h:1640
#define soap_check_state(soap)
Definition: stdsoap2.h:1150
void(* fseterror)(struct soap *, const char **c, const char **s)
Definition: stdsoap2.h:1660
static int tcp_shutdownsocket(struct soap *, int, int)
Definition: stdsoap2.cpp:6108
int(* fsend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1657
static int fsend(struct soap *, const char *, size_t)
Definition: stdsoap2.cpp:526
int soap_closesock(struct soap *soap)
Definition: stdsoap2.cpp:6121
int(* fparsehdr)(struct soap *, const char *, const char *)
Definition: stdsoap2.h:1647
short state
Definition: stdsoap2.h:1599
#define SOAP_INVALID_SOCKET
Definition: stdsoap2.h:697
void * ctx
Definition: stdsoap2.h:1800
int(* fprepareinit)(struct soap *)
Definition: stdsoap2.h:1666
static int http_post(struct soap *, const char *, const char *, int, const char *, const char *, size_t)
Definition: stdsoap2.cpp:18394
void(* fdelete)(struct soap *soap, struct soap_plugin *p)
Definition: stdsoap2.h:1884
char * z_buf
Definition: stdsoap2.h:1828
int(* fresponse)(struct soap *, int, size_t)
Definition: stdsoap2.h:1645
int(* fpreparerecv)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1668
void *(* fmalloc)(struct soap *, size_t)
Definition: stdsoap2.h:1664
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
int(* fclose)(struct soap *)
Definition: stdsoap2.h:1656
static int tcp_connect(struct soap *, const char *endpoint, const char *host, int port)
Definition: stdsoap2.cpp:4648
int(* fignore)(struct soap *, const char *)
Definition: stdsoap2.h:1661
int(* fget)(struct soap *)
Definition: stdsoap2.h:1639
static int tcp_accept(struct soap *, int, struct sockaddr *, int *)
Definition: stdsoap2.cpp:5755
#define SOAP_MAXLOGS
Definition: stdsoap2.h:869
static int http_parse(struct soap *)
Definition: stdsoap2.cpp:16921
struct soap_clist * next
Definition: stdsoap2.h:1327
int(* fparse)(struct soap *)
Definition: stdsoap2.h:1646
void * session
Definition: stdsoap2.h:1801
int(* fopen)(struct soap *, const char *, const char *, int)
Definition: stdsoap2.h:1654
static int tcp_disconnect(struct soap *)
Definition: stdsoap2.cpp:5982
static void * fplugin(struct soap *, const char *)
Definition: stdsoap2.cpp:19476
const char* soap_double2s ( struct soap ,
double   
)

Definition at line 12615 of file stdsoap2.cpp.

References soap::c_locale, soap::double_format, soap_isnan, soap_isninfd, soap_ispinfd, and soap::tmpbuf.

Referenced by soap_outdouble().

12616  {
12617  char *s;
12618 
12619  if (soap_isnan(n))
12620  return "NaN";
12621 
12622  if (soap_ispinfd(n))
12623  return "INF";
12624 
12625  if (soap_isninfd(n))
12626  return "-INF";
12627 
12628  s = soap->tmpbuf;
12629 #if defined(HAVE_SPRINTF_L)
12630  sprintf_l(s, soap->c_locale, soap->double_format, n);
12631 #else
12632  sprintf(s, soap->double_format, n);
12633  s = strchr(s, ','); /* convert decimal comma to DP */
12634 
12635  if (s)
12636  *s = '.';
12637 
12638 #endif
12639  return soap->tmpbuf;
12640  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
#define soap_ispinfd(n)
Definition: stdsoap2.h:986
#define soap_isnan(n)
Definition: stdsoap2.h:982
void * c_locale
Definition: stdsoap2.h:1816
#define soap_isninfd(n)
Definition: stdsoap2.h:988
const char * double_format
Definition: stdsoap2.h:1605
int soap_element ( struct soap ,
const char *  ,
int  ,
const char *   
)

Definition at line 9009 of file stdsoap2.cpp.

References soap::actor, soap_dom_element::atts, soap::body, soap_dom_element::data, DBGLOG, soap::dom, soap_dom_element::elts, soap::encoding, soap::encodingStyle, soap::error, soap_dom_element::head, Namespace::id, soap_nlist::id, soap_nlist::index, soap::level, soap::local_namespaces, soap::mode, soap::mustUnderstand, soap_dom_element::name, soap_nlist::next, soap_dom_element::next, soap::nlist, soap_dom_element::node, Namespace::ns, soap::ns, soap_dom_element::nstr, soap::null, Namespace::out, soap::part, soap::position, soap::positions, soap_dom_element::prnt, soap::prolog, soap_dom_element::soap, soap_attribute(), SOAP_BEGIN_SECURITY, SOAP_DOM_ASIS, SOAP_IN_BODY, SOAP_IN_SECURITY, soap_malloc(), SOAP_OK, soap_push_ns(), soap_send(), soap_send_raw(), SOAP_STR_EOS, soap_strdup(), soap_utilize_ns(), SOAP_XML_CANONICAL, SOAP_XML_DOM, SOAP_XML_INDENT, SOAP_XML_SEC, soap_dom_element::tail, soap::tmpbuf, soap_dom_element::type, soap::version, and soap_dom_element::wide.

Referenced by soap_array_begin_out(), soap_body_begin_out(), soap_element_begin_out(), soap_element_href(), soap_element_null(), soap_element_result(), soap_outliteral(), and soap_outwliteral().

9010  {
9011 #ifdef WITH_XMLNS
9012  register const char *s;
9013 #endif
9014  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element begin tag='%s' id='%d' type='%s'\n", tag, id, type ? type : SOAP_STR_EOS));
9015 #ifdef WITH_DOM
9016 
9018  {
9019  register struct soap_nlist *np;
9020 
9021  /* wsu:Id found: clear xmlns renderings, so re-emit them for exc-c14n */
9022  for (np = soap->nlist; np; np = np->next)
9023  {
9024  if (np->index == 2)
9025  np->index = 0;
9026  }
9027  }
9028 
9029  if (soap->mode & SOAP_XML_DOM)
9030  {
9031  register struct soap_dom_element *elt = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element));
9032 
9033  if (!elt)
9034  return soap->error;
9035 
9036  elt->soap = soap;
9037  elt->next = NULL;
9038  elt->prnt = soap->dom;
9039  elt->name = soap_strdup(soap, tag);
9040  elt->elts = NULL;
9041  elt->atts = NULL;
9042  elt->nstr = NULL;
9043  elt->data = NULL;
9044  elt->wide = NULL;
9045  elt->node = NULL;
9046  elt->type = 0;
9047  elt->head = NULL;
9048  elt->tail = NULL;
9049 
9050  if (soap->dom)
9051  {
9052  struct soap_dom_element *p = soap->dom->elts;
9053 
9054  if (p)
9055  {
9056  while (p->next)
9057  p = p->next;
9058 
9059  p->next = elt;
9060  }
9061  else
9062  soap->dom->elts = elt;
9063  }
9064 
9065  soap->dom = elt;
9066  }
9067  else
9068  {
9069 #endif
9070  soap->level++;
9071 #ifndef WITH_LEAN
9072 
9073  if (!soap->ns)
9074  {
9075  if (!(soap->mode & SOAP_XML_CANONICAL)
9076  && soap_send(soap, soap->prolog ? soap->prolog : "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"))
9077  return soap->error;
9078  }
9079  else if (soap->mode & SOAP_XML_INDENT)
9080  {
9081  if (soap->ns == 1 && soap_send_raw(soap, soap_indent, soap->level < sizeof(soap_indent) ? soap->level : sizeof(soap_indent) - 1))
9082  return soap->error;
9083 
9084  soap->body = 1;
9085  }
9086 
9087 #endif
9088 #ifdef WITH_XMLNS
9089  s = strchr(tag, ':');
9090 
9091  if (s && strncmp(tag, "SOAP-ENV", s - tag))
9092  {
9093  struct Namespace *ns = soap->local_namespaces;
9094  size_t n = s - tag;
9095 
9096  if (soap_send_raw(soap, "<", 1)
9097  || soap_send(soap, s + 1))
9098  return soap->error;
9099 
9100  if (soap->nlist && !strncmp(soap->nlist->id, tag, n) && !soap->nlist->id[n])
9101  ns = NULL;
9102 
9103  for (; ns && ns->id; ns++)
9104  {
9105  if (*ns->id && (ns->out || ns->ns) && !strncmp(ns->id, tag, n) && !ns->id[n])
9106  {
9107  soap_push_ns(soap, ns->id, ns->out ? ns->out : ns->ns, 0);
9108 
9109  if (soap_attribute(soap, "xmlns", ns->out ? ns->out : ns->ns))
9110  return soap->error;
9111 
9112  break;
9113  }
9114  }
9115  }
9116  else
9117 #endif
9118  if (soap_send_raw(soap, "<", 1)
9119  || soap_send(soap, tag))
9120  return soap->error;
9121 
9122 #ifdef WITH_DOM
9123  }
9124 
9125 #endif
9126 
9127  if (!soap->ns)
9128  {
9129  struct Namespace *ns;
9130 
9131  for (ns = soap->local_namespaces; ns && ns->id; ns++)
9132  {
9133  if (*ns->id && (ns->out || ns->ns))
9134  {
9135  sprintf(soap->tmpbuf, "xmlns:%s", ns->id);
9136 
9137  if (soap_attribute(soap, soap->tmpbuf, ns->out ? ns->out : ns->ns))
9138  return soap->error;
9139  }
9140  }
9141  }
9142 
9143  soap->ns = 1; /* namespace table control: ns = 0 or 2 to start, then 1 to stop dumping the table */
9144 #ifndef WITH_LEAN
9145 
9146  if (soap->mode & SOAP_XML_CANONICAL)
9147  {
9148  const char *t = strchr(tag, ':');
9149 
9150  if (t)
9151  soap_utilize_ns(soap, tag, t - tag);
9152  }
9153 
9154 #endif
9155 
9156  if (id > 0)
9157  {
9158  sprintf(soap->tmpbuf, "_%d", id);
9159 
9160  if (soap_attribute(soap, "id", soap->tmpbuf))
9161  return soap->error;
9162  }
9163 
9164  if (type && *type && (!(soap->mode & SOAP_XML_SEC) || soap->part == SOAP_IN_BODY))
9165  {
9166  if (soap_attribute(soap, "xsi:type", type))
9167  return soap->error;
9168 
9169 #ifndef WITH_LEAN
9170 
9171  if (soap->mode & SOAP_XML_CANONICAL)
9172  {
9173  const char *t = strchr(type, ':');
9174 
9175  if (t)
9176  soap_utilize_ns(soap, type, t - type);
9177  }
9178 
9179 #endif
9180  }
9181 
9182  if (soap->null && soap->position > 0)
9183  {
9184  register int i;
9185  sprintf(soap->tmpbuf, "[%d", soap->positions[0]);
9186 
9187  for (i = 1; i < soap->position; i++)
9188  sprintf(soap->tmpbuf + strlen(soap->tmpbuf), ",%d", soap->positions[i]);
9189 
9190  strcat(soap->tmpbuf, "]");
9191 
9192  if (soap_attribute(soap, "SOAP-ENC:position", soap->tmpbuf))
9193  return soap->error;
9194  }
9195 
9196  if (soap->mustUnderstand)
9197  {
9198  if (soap->actor && *soap->actor)
9199  {
9200  if (soap_attribute(soap, soap->version == 2 ? "SOAP-ENV:role" : "SOAP-ENV:actor", soap->actor))
9201  return soap->error;
9202  }
9203 
9204  if (soap_attribute(soap, "SOAP-ENV:mustUnderstand", soap->version == 2 ? "true" : "1"))
9205  return soap->error;
9206 
9207  soap->mustUnderstand = 0;
9208  }
9209 
9210  if (soap->encoding)
9211  {
9213  {
9214  if (!*soap->encodingStyle)
9215  {
9216  if (soap->local_namespaces[1].out)
9218  else
9220  }
9221 
9222  if (soap_attribute(soap, "SOAP-ENV:encodingStyle", soap->encodingStyle))
9223  return soap->error;
9224  }
9225 
9226  soap->encoding = 0;
9227  }
9228 
9229  soap->null = 0;
9230  soap->position = 0;
9231 
9234 
9235  return SOAP_OK;
9236  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
static const char soap_indent[11]
Definition: stdsoap2.cpp:298
char * prolog
Definition: stdsoap2.h:1739
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
short part
Definition: stdsoap2.h:1729
soap_mode mode
Definition: stdsoap2.h:1601
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
short ns
Definition: stdsoap2.h:1728
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
short version
Definition: stdsoap2.h:1600
#define SOAP_XML_INDENT
Definition: stdsoap2.h:1108
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_DOM_ASIS
Definition: stdsoap2.h:1123
struct soap * soap
Definition: stdsoap2.h:1550
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
struct soap_dom_element * prnt
Definition: stdsoap2.h:1539
char id[1]
Definition: stdsoap2.h:1275
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
const char * actor
Definition: stdsoap2.h:1610
int soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:959
char * out
Definition: stdsoap2.h:1265
short index
Definition: stdsoap2.h:1273
static struct soap_nlist * soap_push_ns(struct soap *soap, const char *id, const char *ns, short utilized)
Definition: stdsoap2.cpp:8914
#define SOAP_BEGIN_SECURITY
Definition: stdsoap2.h:1163
#define SOAP_XML_SEC
Definition: stdsoap2.h:1114
short encoding
Definition: stdsoap2.h:1725
const char * ns
Definition: stdsoap2.h:1263
struct soap_dom_element * next
Definition: stdsoap2.h:1538
#define SOAP_IN_SECURITY
Definition: stdsoap2.h:1164
struct soap_nlist * next
Definition: stdsoap2.h:1271
short mustUnderstand
Definition: stdsoap2.h:1726
#define SOAP_IN_BODY
Definition: stdsoap2.h:1159
#define SOAP_OK
Definition: stdsoap2.h:995
int positions[(16)]
Definition: stdsoap2.h:1722
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
static void soap_utilize_ns(struct soap *soap, const char *tag, size_t n)
Definition: stdsoap2.cpp:8976
short position
Definition: stdsoap2.h:1721
struct soap_dom_attribute * atts
Definition: stdsoap2.h:1541
struct soap_dom_element * elts
Definition: stdsoap2.h:1540
wchar_t * wide
Definition: stdsoap2.h:1545
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
short body
Definition: stdsoap2.h:1703
short null
Definition: stdsoap2.h:1727
const char * id
Definition: stdsoap2.h:1262
const char * nstr
Definition: stdsoap2.h:1542
int soap_attribute(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:9802
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
const char * encodingStyle
Definition: stdsoap2.h:1609
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
int soap_element_begin_in ( struct soap ,
const char *  tag,
int  nillable,
const char *  type 
)

Definition at line 9864 of file stdsoap2.cpp.

References soap::body, DBGLOG, soap::error, soap::level, soap::mode, soap::null, soap::other, soap::peeked, soap_match_tag(), SOAP_NO_TAG, SOAP_NULL, SOAP_OK, soap_peek_element(), SOAP_STR_EOS, SOAP_TAG_MISMATCH, SOAP_TYPE, SOAP_XML_STRICT, soap::tag, and soap::type.

Referenced by soap_body_begin_in(), soap_envelope_begin_in(), soap_in_ArrayOf_USCORExsd_USCOREstring(), soap_in_ns2__checkRegExp(), soap_in_ns2__checkRegExpResponse(), soap_in_ns2__getDataResources(), soap_in_ns2__getDataResourcesResponse(), soap_in_ns2__getDataTypeDef(), soap_in_ns2__getDataTypeDefResponse(), soap_in_ns2__getDataTypePattern(), soap_in_ns2__getDataTypePatternResponse(), soap_in_ns2__getDataTypesId(), soap_in_ns2__getDataTypesIdResponse(), soap_in_ns2__getDataTypesName(), soap_in_ns2__getDataTypesNameResponse(), soap_in_ns2__getDataTypeSynonyms(), soap_in_ns2__getDataTypeSynonymsResponse(), soap_in_ns2__getDataTypeURI(), soap_in_ns2__getDataTypeURIResponse(), soap_in_ns2__getDataTypeURIs(), soap_in_ns2__getDataTypeURIsResponse(), soap_in_ns2__getJavaLibraryVersion(), soap_in_ns2__getJavaLibraryVersionResponse(), soap_in_ns2__getLocation(), soap_in_ns2__getLocationResponse(), soap_in_ns2__getLocations(), soap_in_ns2__getLocations_(), soap_in_ns2__getLocationsResponse(), soap_in_ns2__getLocationsResponse_(), soap_in_ns2__getMiriamURI(), soap_in_ns2__getMiriamURIResponse(), soap_in_ns2__getName(), soap_in_ns2__getNameResponse(), soap_in_ns2__getNames(), soap_in_ns2__getNamesResponse(), soap_in_ns2__getOfficialDataTypeURI(), soap_in_ns2__getOfficialDataTypeURIResponse(), soap_in_ns2__getResourceInfo(), soap_in_ns2__getResourceInfoResponse(), soap_in_ns2__getResourceInstitution(), soap_in_ns2__getResourceInstitutionResponse(), soap_in_ns2__getResourceLocation(), soap_in_ns2__getResourceLocationResponse(), soap_in_ns2__getServicesInfo(), soap_in_ns2__getServicesInfoResponse(), soap_in_ns2__getServicesVersion(), soap_in_ns2__getServicesVersionResponse(), soap_in_ns2__getURI(), soap_in_ns2__getURIResponse(), soap_in_ns2__isDeprecated(), soap_in_ns2__isDeprecatedResponse(), soap_in_PointerToArrayOf_USCORExsd_USCOREstring(), soap_in_PointerToSOAP_ENV__Code(), soap_in_PointerToSOAP_ENV__Detail(), soap_in_PointerToSOAP_ENV__Reason(), soap_in_PointerTostd__string(), soap_in_SOAP_ENV__Code(), soap_in_SOAP_ENV__Detail(), soap_in_SOAP_ENV__Fault(), soap_in_SOAP_ENV__Header(), soap_in_SOAP_ENV__Reason(), soap_in_std__string(), soap_inbyte(), soap_indateTime(), soap_indouble(), soap_infloat(), soap_inint(), soap_inliteral(), soap_inlong(), soap_inLONG64(), soap_inshort(), soap_instring(), soap_inULONG64(), soap_inunsignedByte(), soap_inunsignedInt(), soap_inunsignedLong(), soap_inunsignedShort(), soap_inwliteral(), soap_inwstring(), and soap_xop_forward().

9865  {
9866  if (!soap_peek_element(soap))
9867  {
9868  if (soap->other)
9869  return soap->error = SOAP_TAG_MISMATCH;
9870 
9871  if (tag && *tag == '-')
9872  return SOAP_OK;
9873 
9874  if (!(soap->error = soap_match_tag(soap, soap->tag, tag)))
9875  {
9876  soap->peeked = 0;
9877 
9878  if (type && *soap->type && soap_match_tag(soap, soap->type, type))
9879  return soap->error = SOAP_TYPE;
9880 
9881  if (!nillable && soap->null && (soap->mode & SOAP_XML_STRICT))
9882  return soap->error = SOAP_NULL;
9883 
9884  if (soap->body)
9885  soap->level++;
9886 
9887  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS));
9888  }
9889  }
9890  else if (soap->error == SOAP_NO_TAG && tag && *tag == '-')
9891  soap->error = SOAP_OK;
9892 
9893  return soap->error;
9894  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
char tag[(1024)]
Definition: stdsoap2.h:1713
int soap_peek_element(struct soap *soap)
Definition: stdsoap2.cpp:10336
int error
Definition: stdsoap2.h:1755
#define SOAP_NULL
Definition: stdsoap2.h:1018
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_NO_TAG
Definition: stdsoap2.h:1001
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_TYPE
Definition: stdsoap2.h:999
short peeked
Definition: stdsoap2.h:1731
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
#define SOAP_TAG_MISMATCH
Definition: stdsoap2.h:998
#define SOAP_OK
Definition: stdsoap2.h:995
char type[(1024)]
Definition: stdsoap2.h:1716
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
short body
Definition: stdsoap2.h:1703
short null
Definition: stdsoap2.h:1727
short other
Definition: stdsoap2.h:1720
int soap_element_begin_out ( struct soap ,
const char *  tag,
int  id,
const char *  type 
)

Definition at line 9244 of file stdsoap2.cpp.

References soap::error, soap_element(), soap_element_start_end_out(), and SOAP_OK.

Referenced by soap_array_begin_out(), soap_attachment(), soap_envelope_begin_out(), soap_out_ns2__checkRegExp(), soap_out_ns2__checkRegExpResponse(), soap_out_ns2__getDataResources(), soap_out_ns2__getDataResourcesResponse(), soap_out_ns2__getDataTypeDef(), soap_out_ns2__getDataTypeDefResponse(), soap_out_ns2__getDataTypePattern(), soap_out_ns2__getDataTypePatternResponse(), soap_out_ns2__getDataTypesId(), soap_out_ns2__getDataTypesIdResponse(), soap_out_ns2__getDataTypesName(), soap_out_ns2__getDataTypesNameResponse(), soap_out_ns2__getDataTypeSynonyms(), soap_out_ns2__getDataTypeSynonymsResponse(), soap_out_ns2__getDataTypeURI(), soap_out_ns2__getDataTypeURIResponse(), soap_out_ns2__getDataTypeURIs(), soap_out_ns2__getDataTypeURIsResponse(), soap_out_ns2__getJavaLibraryVersion(), soap_out_ns2__getJavaLibraryVersionResponse(), soap_out_ns2__getLocation(), soap_out_ns2__getLocationResponse(), soap_out_ns2__getLocations(), soap_out_ns2__getLocations_(), soap_out_ns2__getLocationsResponse(), soap_out_ns2__getLocationsResponse_(), soap_out_ns2__getMiriamURI(), soap_out_ns2__getMiriamURIResponse(), soap_out_ns2__getName(), soap_out_ns2__getNameResponse(), soap_out_ns2__getNames(), soap_out_ns2__getNamesResponse(), soap_out_ns2__getOfficialDataTypeURI(), soap_out_ns2__getOfficialDataTypeURIResponse(), soap_out_ns2__getResourceInfo(), soap_out_ns2__getResourceInfoResponse(), soap_out_ns2__getResourceInstitution(), soap_out_ns2__getResourceInstitutionResponse(), soap_out_ns2__getResourceLocation(), soap_out_ns2__getResourceLocationResponse(), soap_out_ns2__getServicesInfo(), soap_out_ns2__getServicesInfoResponse(), soap_out_ns2__getServicesVersion(), soap_out_ns2__getServicesVersionResponse(), soap_out_ns2__getURI(), soap_out_ns2__getURIResponse(), soap_out_ns2__isDeprecated(), soap_out_ns2__isDeprecatedResponse(), soap_out_SOAP_ENV__Code(), soap_out_SOAP_ENV__Detail(), soap_out_SOAP_ENV__Fault(), soap_out_SOAP_ENV__Header(), soap_out_SOAP_ENV__Reason(), soap_out_std__string(), soap_outbyte(), soap_outdateTime(), soap_outdouble(), soap_outfloat(), soap_outint(), soap_outliteral(), soap_outlong(), soap_outLONG64(), soap_outshort(), soap_outstring(), soap_outULONG64(), soap_outunsignedByte(), soap_outunsignedInt(), soap_outunsignedLong(), soap_outunsignedShort(), soap_outwliteral(), and soap_outwstring().

9245  {
9246  if (*tag == '-')
9247  return SOAP_OK;
9248 
9249  if (soap_element(soap, tag, id, type))
9250  return soap->error;
9251 
9252  return soap_element_start_end_out(soap, NULL);
9253  }
int soap_element(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9009
int error
Definition: stdsoap2.h:1755
int soap_element_start_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9458
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_element_end_in ( struct soap ,
const char *  tag 
)

Definition at line 9902 of file stdsoap2.cpp.

References DBGLOG, soap::dom, soap::error, soap::level, soap::mode, soap::peeked, soap_dom_element::prnt, soap_blank, SOAP_EOF, soap_get(), SOAP_GT, SOAP_LT, soap_match_tag(), SOAP_NO_TAG, soap_notblank, SOAP_OK, soap_pop_namespace(), SOAP_STR_EOS, soap_string_in(), SOAP_SYNTAX_ERROR, SOAP_TT, soap_unget, SOAP_XML_DOM, SOAP_XML_STRICT, and soap::tag.

Referenced by soap_body_end_in(), soap_envelope_end_in(), soap_ignore_element(), soap_in_ArrayOf_USCORExsd_USCOREstring(), soap_in_ns2__checkRegExp(), soap_in_ns2__checkRegExpResponse(), soap_in_ns2__getDataResources(), soap_in_ns2__getDataResourcesResponse(), soap_in_ns2__getDataTypeDef(), soap_in_ns2__getDataTypeDefResponse(), soap_in_ns2__getDataTypePattern(), soap_in_ns2__getDataTypePatternResponse(), soap_in_ns2__getDataTypesId(), soap_in_ns2__getDataTypesIdResponse(), soap_in_ns2__getDataTypesName(), soap_in_ns2__getDataTypesNameResponse(), soap_in_ns2__getDataTypeSynonyms(), soap_in_ns2__getDataTypeSynonymsResponse(), soap_in_ns2__getDataTypeURI(), soap_in_ns2__getDataTypeURIResponse(), soap_in_ns2__getDataTypeURIs(), soap_in_ns2__getDataTypeURIsResponse(), soap_in_ns2__getJavaLibraryVersion(), soap_in_ns2__getJavaLibraryVersionResponse(), soap_in_ns2__getLocation(), soap_in_ns2__getLocationResponse(), soap_in_ns2__getLocations(), soap_in_ns2__getLocations_(), soap_in_ns2__getLocationsResponse(), soap_in_ns2__getLocationsResponse_(), soap_in_ns2__getMiriamURI(), soap_in_ns2__getMiriamURIResponse(), soap_in_ns2__getName(), soap_in_ns2__getNameResponse(), soap_in_ns2__getNames(), soap_in_ns2__getNamesResponse(), soap_in_ns2__getOfficialDataTypeURI(), soap_in_ns2__getOfficialDataTypeURIResponse(), soap_in_ns2__getResourceInfo(), soap_in_ns2__getResourceInfoResponse(), soap_in_ns2__getResourceInstitution(), soap_in_ns2__getResourceInstitutionResponse(), soap_in_ns2__getResourceLocation(), soap_in_ns2__getResourceLocationResponse(), soap_in_ns2__getServicesInfo(), soap_in_ns2__getServicesInfoResponse(), soap_in_ns2__getServicesVersion(), soap_in_ns2__getServicesVersionResponse(), soap_in_ns2__getURI(), soap_in_ns2__getURIResponse(), soap_in_ns2__isDeprecated(), soap_in_ns2__isDeprecatedResponse(), soap_in_PointerToArrayOf_USCORExsd_USCOREstring(), soap_in_PointerToSOAP_ENV__Code(), soap_in_PointerToSOAP_ENV__Detail(), soap_in_PointerToSOAP_ENV__Reason(), soap_in_PointerTostd__string(), soap_in_SOAP_ENV__Code(), soap_in_SOAP_ENV__Detail(), soap_in_SOAP_ENV__Fault(), soap_in_SOAP_ENV__Header(), soap_in_SOAP_ENV__Reason(), soap_in_std__string(), soap_inbyte(), soap_indateTime(), soap_indouble(), soap_infloat(), soap_inint(), soap_inliteral(), soap_inlong(), soap_inLONG64(), soap_inshort(), soap_instring(), soap_inULONG64(), soap_inunsignedByte(), soap_inunsignedInt(), soap_inunsignedLong(), soap_inunsignedShort(), soap_inwliteral(), soap_inwstring(), and soap_xop_forward().

9903  {
9904  register soap_wchar c;
9905  register char *s;
9906  register int n = 0;
9907 
9908  if (tag && *tag == '-')
9909  return SOAP_OK;
9910 
9911  if (soap->error == SOAP_NO_TAG)
9912  soap->error = SOAP_OK;
9913 
9914 #ifdef WITH_DOM
9915 
9916  /* this whitespace or mixed content is not insignificant for DOM */
9917  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
9918  {
9919  if (!soap->peeked && !soap_string_in(soap, 3, -1, -1))
9920  return soap->error;
9921 
9922  if (soap->dom->prnt)
9923  soap->dom = soap->dom->prnt;
9924  }
9925 
9926 #endif
9927 
9928  if (soap->peeked)
9929  {
9930  if (*soap->tag)
9931  n++;
9932 
9933  soap->peeked = 0;
9934  }
9935 
9936  do
9937  {
9938  while (((c = soap_get(soap)) != SOAP_TT))
9939  {
9940  if ((int)c == EOF)
9941  return soap->error = SOAP_EOF;
9942 
9943  if (c == SOAP_LT)
9944  n++;
9945  else if (c == '/')
9946  {
9947  c = soap_get(soap);
9948 
9949  if (c == SOAP_GT)
9950  n--;
9951  else
9952  soap_unget(soap, c);
9953  }
9954  }
9955  }
9956  while (n--);
9957 
9958  s = soap->tag;
9959  n = sizeof(soap->tag);
9960 
9961  while (soap_notblank(c = soap_get(soap)))
9962  {
9963  if (--n > 0)
9964  * s++ = (char)c;
9965  }
9966 
9967  *s = '\0';
9968 
9969  if ((int)c == EOF)
9970  return soap->error = SOAP_EOF;
9971 
9972  while (soap_blank(c))
9973  c = soap_get(soap);
9974 
9975  if (c != SOAP_GT)
9976  return soap->error = SOAP_SYNTAX_ERROR;
9977 
9978  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag ? tag : SOAP_STR_EOS));
9979 #ifndef WITH_LEAN
9980 
9981  if (tag && (soap->mode & SOAP_XML_STRICT))
9982  {
9984 
9985  if (soap_match_tag(soap, soap->tag, tag))
9986  {
9987  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element tag name does not match\n"));
9988  return soap->error = SOAP_SYNTAX_ERROR;
9989  }
9990  }
9991 
9992 #endif
9993  soap->level--;
9994  return SOAP_OK;
9995  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
char tag[(1024)]
Definition: stdsoap2.h:1713
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
soap_wchar soap_get(struct soap *soap)
Definition: stdsoap2.cpp:1856
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_NO_TAG
Definition: stdsoap2.h:1001
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_dom_element * prnt
Definition: stdsoap2.h:1539
short peeked
Definition: stdsoap2.h:1731
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
#define soap_blank(c)
Definition: stdsoap2.cpp:118
void soap_pop_namespace(struct soap *soap)
Definition: stdsoap2.cpp:3565
#define SOAP_TT
Definition: stdsoap2.cpp:113
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
char * soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
Definition: stdsoap2.cpp:11015
#define SOAP_GT
Definition: stdsoap2.cpp:114
#define SOAP_SYNTAX_ERROR
Definition: stdsoap2.h:1000
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
#define SOAP_EOF
Definition: stdsoap2.h:993
#define soap_notblank(c)
Definition: stdsoap2.cpp:119
#define SOAP_LT
Definition: stdsoap2.cpp:112
int32_t soap_wchar
Definition: stdsoap2.h:1257
int soap_element_end_out ( struct soap ,
const char *  tag 
)

Definition at line 9588 of file stdsoap2.cpp.

References soap::body, DBGLOG, soap::dom, soap::error, soap::level, soap::mode, soap_dom_element::prnt, SOAP_OK, soap_pop_ns(), soap_send(), soap_send_raw(), SOAP_XML_CANONICAL, SOAP_XML_DOM, and SOAP_XML_INDENT.

Referenced by soap_attachment(), soap_body_end_out(), soap_element_result(), soap_element_start_end_out(), soap_envelope_end_out(), soap_out_ArrayOf_USCORExsd_USCOREstring(), soap_out_ns2__checkRegExp(), soap_out_ns2__checkRegExpResponse(), soap_out_ns2__getDataResources(), soap_out_ns2__getDataResourcesResponse(), soap_out_ns2__getDataTypeDef(), soap_out_ns2__getDataTypeDefResponse(), soap_out_ns2__getDataTypePattern(), soap_out_ns2__getDataTypePatternResponse(), soap_out_ns2__getDataTypesId(), soap_out_ns2__getDataTypesIdResponse(), soap_out_ns2__getDataTypesName(), soap_out_ns2__getDataTypesNameResponse(), soap_out_ns2__getDataTypeSynonyms(), soap_out_ns2__getDataTypeSynonymsResponse(), soap_out_ns2__getDataTypeURI(), soap_out_ns2__getDataTypeURIResponse(), soap_out_ns2__getDataTypeURIs(), soap_out_ns2__getDataTypeURIsResponse(), soap_out_ns2__getJavaLibraryVersion(), soap_out_ns2__getJavaLibraryVersionResponse(), soap_out_ns2__getLocation(), soap_out_ns2__getLocationResponse(), soap_out_ns2__getLocations(), soap_out_ns2__getLocations_(), soap_out_ns2__getLocationsResponse(), soap_out_ns2__getLocationsResponse_(), soap_out_ns2__getMiriamURI(), soap_out_ns2__getMiriamURIResponse(), soap_out_ns2__getName(), soap_out_ns2__getNameResponse(), soap_out_ns2__getNames(), soap_out_ns2__getNamesResponse(), soap_out_ns2__getOfficialDataTypeURI(), soap_out_ns2__getOfficialDataTypeURIResponse(), soap_out_ns2__getResourceInfo(), soap_out_ns2__getResourceInfoResponse(), soap_out_ns2__getResourceInstitution(), soap_out_ns2__getResourceInstitutionResponse(), soap_out_ns2__getResourceLocation(), soap_out_ns2__getResourceLocationResponse(), soap_out_ns2__getServicesInfo(), soap_out_ns2__getServicesInfoResponse(), soap_out_ns2__getServicesVersion(), soap_out_ns2__getServicesVersionResponse(), soap_out_ns2__getURI(), soap_out_ns2__getURIResponse(), soap_out_ns2__isDeprecated(), soap_out_ns2__isDeprecatedResponse(), soap_out_SOAP_ENV__Code(), soap_out_SOAP_ENV__Detail(), soap_out_SOAP_ENV__Fault(), soap_out_SOAP_ENV__Header(), soap_out_SOAP_ENV__Reason(), soap_out_std__string(), soap_outbyte(), soap_outdateTime(), soap_outdouble(), soap_outfloat(), soap_outint(), soap_outliteral(), soap_outlong(), soap_outLONG64(), soap_outshort(), soap_outstring(), soap_outULONG64(), soap_outunsignedByte(), soap_outunsignedInt(), soap_outunsignedLong(), soap_outunsignedShort(), soap_outwliteral(), and soap_outwstring().

9589  {
9590  if (*tag == '-')
9591  return SOAP_OK;
9592 
9593  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element ending tag='%s'\n", tag));
9594 #ifdef WITH_DOM
9595 
9596  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
9597  {
9598  if (soap->dom->prnt)
9599  soap->dom = soap->dom->prnt;
9600 
9601  return SOAP_OK;
9602  }
9603 
9604 #endif
9605 #ifndef WITH_LEAN
9606 
9607  if (soap->mode & SOAP_XML_CANONICAL)
9608  soap_pop_ns(soap);
9609 
9610  if (soap->mode & SOAP_XML_INDENT)
9611  {
9612  if (!soap->body)
9613  {
9614  if (soap_send_raw(soap, soap_indent, soap->level < sizeof(soap_indent) ? soap->level : sizeof(soap_indent) - 1))
9615  return soap->error;
9616  }
9617 
9618  soap->body = 0;
9619  }
9620 
9621 #endif
9622 #ifdef WITH_XMLNS
9623  {const char *s = strchr(tag, ':');
9624 
9625  if (s && strncmp(tag, "SOAP-ENV", s - tag))
9626  {
9627  soap_pop_ns(soap);
9628  tag = s + 1;
9629  }
9630  }
9631 #endif
9632 
9633  if (soap_send_raw(soap, "</", 2)
9634  || soap_send(soap, tag))
9635  return soap->error;
9636 
9637  soap->level--; /* decrement level just before > */
9638  return soap_send_raw(soap, ">", 1);
9639  }
static const char soap_indent[11]
Definition: stdsoap2.cpp:298
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define SOAP_XML_INDENT
Definition: stdsoap2.h:1108
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
struct soap_dom_element * prnt
Definition: stdsoap2.h:1539
int soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:959
static void soap_pop_ns(struct soap *soap)
Definition: stdsoap2.cpp:8998
#define SOAP_OK
Definition: stdsoap2.h:995
short body
Definition: stdsoap2.h:1703
int soap_element_href ( struct soap ,
const char *  tag,
int  id,
const char *  ref,
const char *  val 
)

Definition at line 9668 of file stdsoap2.cpp.

References DBGLOG, soap::error, soap_attribute(), soap_element(), soap_element_start_end_out(), and SOAP_OK.

Referenced by soap_attachment(), and soap_element_ref().

9669  {
9670  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element '%s' reference %s='%s'\n", tag, ref, val));
9671 
9672  if (soap_element(soap, tag, id, NULL)
9673  || soap_attribute(soap, ref, val)
9675  return soap->error;
9676 
9677  return SOAP_OK;
9678  }
int soap_element(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9009
int error
Definition: stdsoap2.h:1755
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int soap_element_start_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9458
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_attribute(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:9802
int soap_element_id ( struct soap ,
const char *  tag,
int  id,
const void p,
const struct soap_array a,
int  d,
const char *  type,
int  n 
)

Definition at line 9717 of file stdsoap2.cpp.

References soap_plist::id, soap::mode, soap_array_pointer_lookup(), soap_element_null(), soap_element_ref(), soap_is_embedded(), soap_is_single(), soap_pointer_lookup(), soap_set_embedded(), and SOAP_XML_TREE.

Referenced by soap_attachment(), soap_out_ArrayOf_USCORExsd_USCOREstring(), soap_out_PointerToArrayOf_USCORExsd_USCOREstring(), soap_out_PointerToSOAP_ENV__Code(), soap_out_PointerToSOAP_ENV__Detail(), soap_out_PointerToSOAP_ENV__Reason(), soap_out_PointerTostd__string(), soap_outstring(), and soap_outwstring().

9718  {
9719  if (!p)
9720  {
9721  soap_element_null(soap, tag, id, type);
9722  return - 1;
9723  }
9724 
9725 #ifndef WITH_NOIDREF
9726 
9727  if (soap->mode & SOAP_XML_TREE)
9728  return 0;
9729 
9730  if (id < 0)
9731  {
9732  struct soap_plist *pp;
9733 
9734  if (a)
9735  id = soap_array_pointer_lookup(soap, p, a, n, t, &pp);
9736  else
9737  id = soap_pointer_lookup(soap, p, t, &pp);
9738 
9739  if (id)
9740  {
9741  if (soap_is_embedded(soap, pp))
9742  {
9743  soap_element_ref(soap, tag, 0, id);
9744  return - 1;
9745  }
9746 
9747  if (soap_is_single(soap, pp))
9748  return 0;
9749 
9750  soap_set_embedded(soap, pp);
9751  }
9752  }
9753 
9754  return id;
9755 #else
9756  return 0;
9757 #endif
9758  }
soap_mode mode
Definition: stdsoap2.h:1601
void soap_set_embedded(struct soap *soap, struct soap_plist *pp)
Definition: stdsoap2.cpp:6869
int soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6306
int soap_element_null(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9686
int soap_is_embedded(struct soap *soap, struct soap_plist *pp)
Definition: stdsoap2.cpp:6818
#define SOAP_XML_TREE
Definition: stdsoap2.h:1110
int soap_array_pointer_lookup(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6383
int soap_is_single(struct soap *soap, struct soap_plist *pp)
Definition: stdsoap2.cpp:6847
int soap_element_ref(struct soap *soap, const char *tag, int id, int href)
Definition: stdsoap2.cpp:9647
int soap_element_null ( struct soap ,
const char *  tag,
int  id,
const char *  type 
)

Definition at line 9686 of file stdsoap2.cpp.

References soap::attributes, soap::error, soap::mode, soap::mustUnderstand, soap_attribute::next, soap::null, soap::position, soap_attribute(), soap_element(), soap_element_start_end_out(), SOAP_OK, SOAP_XML_NIL, soap::version, and soap_attribute::visible.

Referenced by soap_element_id(), soap_out_std__string(), soap_outstring(), and soap_outwstring().

9687  {
9688  struct soap_attribute *tp;
9689 
9690  for (tp = soap->attributes; tp; tp = tp->next)
9691  if (tp->visible)
9692  break;
9693 
9694  if (tp || (soap->version == 2 && soap->position > 0) || id > 0 || (soap->mode & SOAP_XML_NIL))
9695  {
9696  if (soap_element(soap, tag, id, type))
9697  return soap->error;
9698 
9699  if (!tp && soap_attribute(soap, "xsi:nil", "true"))
9700  return soap->error;
9701 
9702  return soap_element_start_end_out(soap, tag);
9703  }
9704 
9705  soap->null = 1;
9706  soap->position = 0;
9707  soap->mustUnderstand = 0;
9708  return SOAP_OK;
9709  }
int soap_element(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9009
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
short version
Definition: stdsoap2.h:1600
struct soap_attribute * next
Definition: stdsoap2.h:1337
int soap_element_start_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9458
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
short mustUnderstand
Definition: stdsoap2.h:1726
#define SOAP_OK
Definition: stdsoap2.h:995
short position
Definition: stdsoap2.h:1721
#define SOAP_XML_NIL
Definition: stdsoap2.h:1112
short null
Definition: stdsoap2.h:1727
int soap_attribute(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:9802
int soap_element_ref ( struct soap ,
const char *  tag,
int  id,
int  href 
)

Definition at line 9647 of file stdsoap2.cpp.

References soap::href, soap_element_href(), and soap::version.

Referenced by soap_element_id().

9648  {
9649  register int n = 0;
9650  const char *s = "href";
9651 
9652  if (soap->version == 2)
9653  {
9654  s = "SOAP-ENC:ref";
9655  n = 1;
9656  }
9657 
9658  sprintf(soap->href, "#_%d", href);
9659  return soap_element_href(soap, tag, id, s, soap->href + n);
9660  }
short version
Definition: stdsoap2.h:1600
char href[(1024)]
Definition: stdsoap2.h:1715
int soap_element_href(struct soap *soap, const char *tag, int id, const char *ref, const char *val)
Definition: stdsoap2.cpp:9668
int soap_element_result ( struct soap ,
const char *  tag 
)

Definition at line 9766 of file stdsoap2.cpp.

References soap::encodingStyle, soap::error, soap_attribute(), soap_element(), soap_element_end_out(), soap_element_start_end_out(), SOAP_OK, soap_string_out(), and soap::version.

9767  {
9768  if (soap->version == 2 && soap->encodingStyle)
9769  {
9770  if (soap_element(soap, "SOAP-RPC:result", 0, NULL)
9771  || soap_attribute(soap, "xmlns:SOAP-RPC", soap_rpc)
9773  || soap_string_out(soap, tag, 0)
9774  || soap_element_end_out(soap, "SOAP-RPC:result"))
9775  return soap->error;
9776  }
9777 
9778  return SOAP_OK;
9779  }
int soap_element(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9009
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
short version
Definition: stdsoap2.h:1600
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
int soap_element_start_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9458
static const char soap_rpc[35]
Definition: stdsoap2.cpp:288
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_attribute(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:9802
const char * encodingStyle
Definition: stdsoap2.h:1609
int soap_element_start_end_out ( struct soap ,
const char *  tag 
)

Definition at line 9458 of file stdsoap2.cpp.

References soap::attributes, soap_dom_element::atts, DBGLOG, soap::dom, soap::error, soap_nlist::id, soap_nlist::index, soap_nlist::level, soap::level, soap::mode, soap_attribute::name, soap_nlist::next, soap_attribute::next, soap_dom_attribute::next, soap::nlist, soap_nlist::ns, soap_dom_attribute::soap, soap_element_end_out(), soap_malloc(), SOAP_OK, soap_send(), soap_send_raw(), soap_set_attr(), soap_strdup(), soap_string_out(), soap_utilize_ns(), SOAP_XML_CANONICAL, SOAP_XML_DOM, soap::tmpbuf, soap_attribute::value, and soap_attribute::visible.

Referenced by soap_array_begin_out(), soap_body_begin_out(), soap_element_begin_out(), soap_element_href(), soap_element_null(), soap_element_result(), soap_outliteral(), and soap_outwliteral().

9459  {
9460  register struct soap_attribute *tp;
9461 #ifndef WITH_LEAN
9462 
9463  if (soap->mode & SOAP_XML_CANONICAL)
9464  {
9465  struct soap_nlist *np;
9466 
9467  for (tp = soap->attributes; tp; tp = tp->next)
9468  {
9469  if (tp->visible && tp->name)
9470  {
9471  const char * s = strchr(tp->name, ':');
9472 
9473  if (s)
9474  soap_utilize_ns(soap, tp->name, s - tp->name);
9475  }
9476  }
9477 
9478  for (np = soap->nlist; np; np = np->next)
9479  {
9480  if (np->index == 1 && np->ns)
9481  {
9482  sprintf(soap->tmpbuf, "xmlns:%s", np->id);
9483  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enabling utilized binding (level=%u) %s='%s'\n", np->level, soap->tmpbuf, np->ns));
9484  soap_set_attr(soap, soap->tmpbuf, np->ns);
9485  np->index = 2;
9486  }
9487  }
9488  }
9489 
9490 #endif
9491 #ifdef WITH_DOM
9492 
9493  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
9494  {
9495  register struct soap_dom_attribute **att;
9496  att = &soap->dom->atts;
9497 
9498  for (tp = soap->attributes; tp; tp = tp->next)
9499  {
9500  if (tp->visible)
9501  {
9502  *att = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute));
9503 
9504  if (!*att)
9505  return soap->error;
9506 
9507  (*att)->next = NULL;
9508  (*att)->nstr = NULL;
9509  (*att)->name = soap_strdup(soap, tp->name);
9510  (*att)->data = soap_strdup(soap, tp->value);
9511  (*att)->wide = NULL;
9512  (*att)->soap = soap;
9513  att = &(*att)->next;
9514  tp->visible = 0;
9515  }
9516  }
9517 
9518  return SOAP_OK;
9519  }
9520 
9521 #endif
9522 
9523  for (tp = soap->attributes; tp; tp = tp->next)
9524  {
9525  if (tp->visible)
9526  {
9527 #ifdef WITH_XMLNS
9528  const char * s = strchr(tp->name, ':');
9529 
9530  if (s)
9531  {
9532  size_t n = s - tp->name;
9533 
9534  if (soap->nlist && !strncmp(soap->nlist->id, tp->name, n) && !soap->nlist->id[n])
9535  s++;
9536  else
9537  s = tp->name;
9538 
9539  if (soap_send(soap, " ") || soap_send(soap, s))
9540  return soap->error;
9541  }
9542  else
9543 #endif
9544  if (soap_send(soap, " ") || soap_send(soap, tp->name))
9545  return soap->error;
9546 
9547  if (tp->visible == 2 && tp->value)
9548  if (soap_send_raw(soap, "=\"", 2)
9549  || soap_string_out(soap, tp->value, 1)
9550  || soap_send_raw(soap, "\"", 1))
9551  return soap->error;
9552 
9553  tp->visible = 0;
9554  }
9555  }
9556 
9557  if (tag)
9558  {
9559 #ifndef WITH_LEAN
9560 
9561  if (soap->mode & SOAP_XML_CANONICAL)
9562  {
9563  if (soap_send_raw(soap, ">", 1)
9564  || soap_element_end_out(soap, tag))
9565  return soap->error;
9566 
9567  return SOAP_OK;
9568  }
9569 
9570 #endif
9571  soap->level--; /* decrement level just before /> */
9572 
9573  if (soap_send_raw(soap, "/>", 2))
9574  return soap->error;
9575 
9576  return SOAP_OK;
9577  }
9578 
9579  return soap_send_raw(soap, ">", 1);
9580  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
soap_mode mode
Definition: stdsoap2.h:1601
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
struct soap_attribute * next
Definition: stdsoap2.h:1337
char id[1]
Definition: stdsoap2.h:1275
char * ns
Definition: stdsoap2.h:1274
int soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:959
short index
Definition: stdsoap2.h:1273
unsigned int level
Definition: stdsoap2.h:1272
struct soap_nlist * next
Definition: stdsoap2.h:1271
struct soap_dom_attribute * next
Definition: stdsoap2.h:1493
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
char name[1]
Definition: stdsoap2.h:1342
#define SOAP_OK
Definition: stdsoap2.h:995
static void soap_utilize_ns(struct soap *soap, const char *tag, size_t n)
Definition: stdsoap2.cpp:8976
int soap_set_attr(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:10035
struct soap_dom_attribute * atts
Definition: stdsoap2.h:1541
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
char * value
Definition: stdsoap2.h:1338
struct soap * soap
Definition: stdsoap2.h:1498
int soap_embed ( struct soap soap,
const void p,
const struct soap_array a,
int  n,
const char *  tag,
int  type 
)

Definition at line 6273 of file stdsoap2.cpp.

References soap::encoding, soap_array_pointer_lookup(), soap_is_embedded(), soap_is_single(), soap_pointer_lookup(), soap_set_embedded(), and soap::version.

Referenced by ArrayOf_USCORExsd_USCOREstring::soap_put(), soap_put__QName(), soap_put_byte(), soap_put_int(), soap_put_ns2__checkRegExp(), soap_put_ns2__checkRegExpResponse(), soap_put_ns2__getDataResources(), soap_put_ns2__getDataResourcesResponse(), soap_put_ns2__getDataTypeDef(), soap_put_ns2__getDataTypeDefResponse(), soap_put_ns2__getDataTypePattern(), soap_put_ns2__getDataTypePatternResponse(), soap_put_ns2__getDataTypesId(), soap_put_ns2__getDataTypesIdResponse(), soap_put_ns2__getDataTypesName(), soap_put_ns2__getDataTypesNameResponse(), soap_put_ns2__getDataTypeSynonyms(), soap_put_ns2__getDataTypeSynonymsResponse(), soap_put_ns2__getDataTypeURI(), soap_put_ns2__getDataTypeURIResponse(), soap_put_ns2__getDataTypeURIs(), soap_put_ns2__getDataTypeURIsResponse(), soap_put_ns2__getJavaLibraryVersion(), soap_put_ns2__getJavaLibraryVersionResponse(), soap_put_ns2__getLocation(), soap_put_ns2__getLocationResponse(), soap_put_ns2__getLocations(), soap_put_ns2__getLocations_(), soap_put_ns2__getLocationsResponse(), soap_put_ns2__getLocationsResponse_(), soap_put_ns2__getMiriamURI(), soap_put_ns2__getMiriamURIResponse(), soap_put_ns2__getName(), soap_put_ns2__getNameResponse(), soap_put_ns2__getNames(), soap_put_ns2__getNamesResponse(), soap_put_ns2__getOfficialDataTypeURI(), soap_put_ns2__getOfficialDataTypeURIResponse(), soap_put_ns2__getResourceInfo(), soap_put_ns2__getResourceInfoResponse(), soap_put_ns2__getResourceInstitution(), soap_put_ns2__getResourceInstitutionResponse(), soap_put_ns2__getResourceLocation(), soap_put_ns2__getResourceLocationResponse(), soap_put_ns2__getServicesInfo(), soap_put_ns2__getServicesInfoResponse(), soap_put_ns2__getServicesVersion(), soap_put_ns2__getServicesVersionResponse(), soap_put_ns2__getURI(), soap_put_ns2__getURIResponse(), soap_put_ns2__isDeprecated(), soap_put_ns2__isDeprecatedResponse(), soap_put_PointerToArrayOf_USCORExsd_USCOREstring(), soap_put_PointerToSOAP_ENV__Code(), soap_put_PointerToSOAP_ENV__Detail(), soap_put_PointerToSOAP_ENV__Reason(), soap_put_PointerTostd__string(), soap_put_SOAP_ENV__Code(), soap_put_SOAP_ENV__Detail(), soap_put_SOAP_ENV__Fault(), soap_put_SOAP_ENV__Header(), soap_put_SOAP_ENV__Reason(), soap_put_std__string(), and soap_put_string().

6274  {
6275  register int i;
6276  struct soap_plist *pp;
6277 
6278  if (soap->version != 1)
6279  soap->encoding = 1;
6280 
6281  if (a)
6282  i = soap_array_pointer_lookup(soap, p, a, n, type, &pp);
6283  else
6284  i = soap_pointer_lookup(soap, p, type, &pp);
6285 
6286  if (i)
6287  {
6288  if (soap_is_embedded(soap, pp)
6289  || soap_is_single(soap, pp))
6290  return 0;
6291 
6292  soap_set_embedded(soap, pp);
6293  }
6294 
6295  return i;
6296  }
void soap_set_embedded(struct soap *soap, struct soap_plist *pp)
Definition: stdsoap2.cpp:6869
short version
Definition: stdsoap2.h:1600
int soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6306
int soap_is_embedded(struct soap *soap, struct soap_plist *pp)
Definition: stdsoap2.cpp:6818
short encoding
Definition: stdsoap2.h:1725
int soap_array_pointer_lookup(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6383
int soap_is_single(struct soap *soap, struct soap_plist *pp)
Definition: stdsoap2.cpp:6847
void soap_embedded ( struct soap ,
const void p,
int  t 
)

Definition at line 6668 of file stdsoap2.cpp.

References DBGLOG, soap_plist::mark1, soap_plist::mark2, and soap_pointer_lookup().

Referenced by ArrayOf_USCORExsd_USCOREstring::soap_serialize(), soap_serialize_ns2__checkRegExp(), soap_serialize_ns2__checkRegExpResponse(), soap_serialize_ns2__getDataResources(), soap_serialize_ns2__getDataTypeDef(), soap_serialize_ns2__getDataTypeDefResponse(), soap_serialize_ns2__getDataTypePattern(), soap_serialize_ns2__getDataTypePatternResponse(), soap_serialize_ns2__getDataTypeSynonyms(), soap_serialize_ns2__getDataTypeURI(), soap_serialize_ns2__getDataTypeURIResponse(), soap_serialize_ns2__getDataTypeURIs(), soap_serialize_ns2__getJavaLibraryVersionResponse(), soap_serialize_ns2__getLocation(), soap_serialize_ns2__getLocationResponse(), soap_serialize_ns2__getLocations(), soap_serialize_ns2__getLocations_(), soap_serialize_ns2__getMiriamURI(), soap_serialize_ns2__getMiriamURIResponse(), soap_serialize_ns2__getName(), soap_serialize_ns2__getNameResponse(), soap_serialize_ns2__getNames(), soap_serialize_ns2__getOfficialDataTypeURI(), soap_serialize_ns2__getOfficialDataTypeURIResponse(), soap_serialize_ns2__getResourceInfo(), soap_serialize_ns2__getResourceInfoResponse(), soap_serialize_ns2__getResourceInstitution(), soap_serialize_ns2__getResourceInstitutionResponse(), soap_serialize_ns2__getResourceLocation(), soap_serialize_ns2__getResourceLocationResponse(), soap_serialize_ns2__getServicesInfoResponse(), soap_serialize_ns2__getServicesVersionResponse(), soap_serialize_ns2__getURI(), soap_serialize_ns2__getURIResponse(), soap_serialize_ns2__isDeprecated(), and soap_serialize_ns2__isDeprecatedResponse().

6669  {
6670  struct soap_plist *pp;
6671 
6672  if (soap_pointer_lookup(soap, p, t, &pp))
6673  {
6674  pp->mark1 = 1;
6675  pp->mark2 = 1;
6676  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded %p type=%d mark set to 1\n", p, t));
6677  }
6678  }
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char mark1
Definition: stdsoap2.h:1301
int soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6306
char mark2
Definition: stdsoap2.h:1302
int soap_embedded_id ( struct soap ,
int  id,
const void p,
int  t 
)

Definition at line 6761 of file stdsoap2.cpp.

References DBGLOG, soap::encodingStyle, soap_plist::id, soap_plist::mark1, soap_plist::mark2, soap::mode, soap::part, SOAP_IN_HEADER, SOAP_IO_LENGTH, soap_pointer_lookup(), SOAP_XML_GRAPH, SOAP_XML_TREE, and soap::version.

Referenced by soap_out_ns2__checkRegExp(), soap_out_ns2__checkRegExpResponse(), soap_out_ns2__getDataResources(), soap_out_ns2__getDataResourcesResponse(), soap_out_ns2__getDataTypeDef(), soap_out_ns2__getDataTypeDefResponse(), soap_out_ns2__getDataTypePattern(), soap_out_ns2__getDataTypePatternResponse(), soap_out_ns2__getDataTypesId(), soap_out_ns2__getDataTypesIdResponse(), soap_out_ns2__getDataTypesName(), soap_out_ns2__getDataTypesNameResponse(), soap_out_ns2__getDataTypeSynonyms(), soap_out_ns2__getDataTypeSynonymsResponse(), soap_out_ns2__getDataTypeURI(), soap_out_ns2__getDataTypeURIResponse(), soap_out_ns2__getDataTypeURIs(), soap_out_ns2__getDataTypeURIsResponse(), soap_out_ns2__getJavaLibraryVersion(), soap_out_ns2__getJavaLibraryVersionResponse(), soap_out_ns2__getLocation(), soap_out_ns2__getLocationResponse(), soap_out_ns2__getLocations(), soap_out_ns2__getLocations_(), soap_out_ns2__getLocationsResponse(), soap_out_ns2__getLocationsResponse_(), soap_out_ns2__getMiriamURI(), soap_out_ns2__getMiriamURIResponse(), soap_out_ns2__getName(), soap_out_ns2__getNameResponse(), soap_out_ns2__getNames(), soap_out_ns2__getNamesResponse(), soap_out_ns2__getOfficialDataTypeURI(), soap_out_ns2__getOfficialDataTypeURIResponse(), soap_out_ns2__getResourceInfo(), soap_out_ns2__getResourceInfoResponse(), soap_out_ns2__getResourceInstitution(), soap_out_ns2__getResourceInstitutionResponse(), soap_out_ns2__getResourceLocation(), soap_out_ns2__getResourceLocationResponse(), soap_out_ns2__getServicesInfo(), soap_out_ns2__getServicesInfoResponse(), soap_out_ns2__getServicesVersion(), soap_out_ns2__getServicesVersionResponse(), soap_out_ns2__getURI(), soap_out_ns2__getURIResponse(), soap_out_ns2__isDeprecated(), soap_out_ns2__isDeprecatedResponse(), soap_out_SOAP_ENV__Code(), soap_out_SOAP_ENV__Detail(), soap_out_SOAP_ENV__Fault(), soap_out_SOAP_ENV__Header(), soap_out_SOAP_ENV__Reason(), soap_out_std__string(), soap_outbyte(), soap_outdateTime(), soap_outdouble(), soap_outfloat(), soap_outint(), soap_outlong(), soap_outLONG64(), soap_outshort(), soap_outULONG64(), soap_outunsignedByte(), soap_outunsignedInt(), soap_outunsignedLong(), and soap_outunsignedShort().

6762  {
6763  struct soap_plist *pp = NULL;
6764 
6765  if (soap->mode & SOAP_XML_TREE)
6766  return id;
6767 
6768  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id %p type=%d id=%d\n", p, t, id));
6769 
6770  if (soap->version == 1 && soap->encodingStyle && !(soap->mode & SOAP_XML_GRAPH) && soap->part != SOAP_IN_HEADER)
6771  {
6772  if (id < 0)
6773  {
6774  id = soap_pointer_lookup(soap, p, t, &pp);
6775 
6776  if (id)
6777  {
6778  if (soap->mode & SOAP_IO_LENGTH)
6779  pp->mark1 = 2;
6780  else
6781  pp->mark2 = 2;
6782 
6783  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id multiref id=%d %p type=%d = (%d %d)\n", id, p, t, (int)pp->mark1, (int)pp->mark2));
6784  }
6785 
6786  return - 1;
6787  }
6788 
6789  return id;
6790  }
6791 
6792  if (id < 0)
6793  id = soap_pointer_lookup(soap, p, t, &pp);
6794  else if (id && !soap_pointer_lookup(soap, p, t, &pp))
6795  return 0;
6796 
6797  if (id && pp)
6798  {
6799  if (soap->mode & SOAP_IO_LENGTH)
6800  pp->mark1 = 1;
6801  else
6802  pp->mark2 = 1;
6803 
6804  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id embedded ref id=%d %p type=%d = (%d %d)\n", id, p, t, (int)pp->mark1, (int)pp->mark2));
6805  }
6806 
6807  return id;
6808  }
#define SOAP_XML_GRAPH
Definition: stdsoap2.h:1111
short part
Definition: stdsoap2.h:1729
soap_mode mode
Definition: stdsoap2.h:1601
short version
Definition: stdsoap2.h:1600
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char mark1
Definition: stdsoap2.h:1301
int soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6306
#define SOAP_XML_TREE
Definition: stdsoap2.h:1110
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
#define SOAP_IN_HEADER
Definition: stdsoap2.h:1156
char mark2
Definition: stdsoap2.h:1302
const char * encodingStyle
Definition: stdsoap2.h:1609
void soap_end ( struct soap )

Definition at line 8726 of file stdsoap2.cpp.

References soap::clist, soap_clist::next, soap_check_state, soap_closesock(), soap_dealloc(), SOAP_FREE, and soap_free_temp().

8727  {
8728  if (soap_check_state(soap))
8729  return;
8730 
8732  soap_dealloc(soap, NULL);
8733 
8734  while (soap->clist)
8735  {
8736  register struct soap_clist *cp = soap->clist->next;
8737  SOAP_FREE(soap, soap->clist);
8738  soap->clist = cp;
8739  }
8740 
8742 #ifdef SOAP_DEBUG
8743  soap_close_logfiles(soap);
8744 #endif
8745 #ifdef PALM
8746  palmNetLibClose();
8747 #endif
8748  }
void soap_free_temp(struct soap *soap)
Definition: stdsoap2.cpp:8060
void soap_dealloc(struct soap *soap, void *p)
Definition: stdsoap2.cpp:7236
struct soap_clist * clist
Definition: stdsoap2.h:1625
#define soap_check_state(soap)
Definition: stdsoap2.h:1150
int soap_closesock(struct soap *soap)
Definition: stdsoap2.cpp:6121
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
struct soap_clist * next
Definition: stdsoap2.h:1327
void soap_end_block ( struct soap ,
struct soap_blist  
)

Definition at line 3134 of file stdsoap2.cpp.

References soap::blist, DBGLOG, soap_blist::next, soap_blist::ptr, and SOAP_FREE.

Referenced by soap_end_send(), soap_free_temp(), soap_getbase64(), soap_gethex(), and soap_save_block().

3135  {
3136  char *p, *q;
3137 
3138  if (!b)
3139  b = soap->blist;
3140 
3141  if (b)
3142  {
3143  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of block sequence, free all remaining blocks\n"));
3144 
3145  for (p = b->ptr; p; p = q)
3146  {
3147  q = *(char**)p;
3148  SOAP_FREE(soap, p);
3149  }
3150 
3151  if (soap->blist == b)
3152  soap->blist = b->next;
3153  else
3154  {
3155  struct soap_blist *bp;
3156 
3157  for (bp = soap->blist; bp; bp = bp->next)
3158  {
3159  if (bp->next == b)
3160  {
3161  bp->next = b->next;
3162  break;
3163  }
3164  }
3165  }
3166 
3167  SOAP_FREE(soap, b);
3168  }
3169 
3170  DBGLOG(TEST, if (soap->blist) SOAP_MESSAGE(fdebug, "Restore previous block sequence\n"));
3171  }
struct soap_blist * blist
Definition: stdsoap2.h:1624
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
struct soap_blist * next
Definition: stdsoap2.h:1281
int soap_end_count ( struct soap )

Definition at line 6503 of file stdsoap2.cpp.

References DBGLOG, soap::error, soap::fpreparefinal, and SOAP_OK.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_send_fault().

6504  {
6505 #ifndef WITH_LEANER
6506 
6507  if (soap->fpreparefinal)
6508  return soap->error = soap->fpreparefinal(soap);
6509 
6510 #endif
6511  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of count phase\n"));
6512  return SOAP_OK;
6513  }
int error
Definition: stdsoap2.h:1755
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int(* fpreparefinal)(struct soap *)
Definition: stdsoap2.h:1669
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_end_recv ( struct soap )

Definition at line 7925 of file stdsoap2.cpp.

References soap_mime::boundary, soap::buf, soap::bufidx, soap::buflen, soap::d_stream, DBGLOG, soap::dime, soap::error, soap::fdisconnect, soap_dime::first, soap_mime::first, if(), soap_dime::last, soap_mime::last, soap_dime::list, soap_mime::list, soap::mime, soap::mode, soap_multipart::next, soap::part, SOAP_BUFLEN, SOAP_DIME_HREF, SOAP_ENC_DIME, SOAP_ENC_MIME, SOAP_ENC_MTOM, SOAP_ENC_ZLIB, SOAP_END, SOAP_EOF, soap_free_ns(), soap_get1, soap_getchar(), soap_getdime(), soap_getmime(), SOAP_IO, SOAP_IO_CHUNK, SOAP_MIME_HREF, SOAP_MIME_POSTCHECK, SOAP_OK, soap_resolve(), soap_resolve_attachment(), SOAP_ZLIB_ERROR, SOAP_ZLIB_GZIP, SOAP_ZLIB_NONE, soap::xlist, soap::z_buf, soap::z_buflen, soap::z_crc, soap::zlib_in, and soap::zlib_state.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), soap_get_mime_attachment(), soap_recv_empty_response(), and soap_recv_fault().

7926  {
7927  soap->part = SOAP_END;
7928 #ifndef WITH_LEANER
7929 
7930  if ((soap->mode & SOAP_ENC_DIME) && soap_getdime(soap))
7931  {
7932  soap->dime.first = NULL;
7933  soap->dime.last = NULL;
7934  return soap->error;
7935  }
7936 
7937  soap->dime.list = soap->dime.first;
7938  soap->dime.first = NULL;
7939  soap->dime.last = NULL;
7940 
7941  /* Check if MIME attachments and mime-post-check flag is set, if set call soap_resolve() and return */
7942  if (soap->mode & SOAP_ENC_MIME)
7943  {
7944 #ifndef WITH_NOIDREF
7945 
7946  if (soap->mode & SOAP_MIME_POSTCHECK)
7947  {
7948  soap_resolve(soap);
7949  return SOAP_OK;
7950  }
7951 
7952 #endif
7953 
7954  if (soap_getmime(soap))
7955  return soap->error;
7956  }
7957 
7958  soap->mime.list = soap->mime.first;
7959  soap->mime.first = NULL;
7960  soap->mime.last = NULL;
7961  soap->mime.boundary = NULL;
7962 
7963  if (soap->xlist)
7964  {
7965  struct soap_multipart *content;
7966 
7967  for (content = soap->mime.list; content; content = content->next)
7968  soap_resolve_attachment(soap, content);
7969  }
7970 
7971 #endif
7972  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of receive message ok\n"));
7973 #ifdef WITH_ZLIB
7974 
7975  if (soap->mode & SOAP_ENC_ZLIB)
7976  {/* Make sure end of compressed content is reached */
7977  while (soap->d_stream->next_out != Z_NULL)
7978  if ((int)soap_get1(soap) == EOF)
7979  break;
7980 
7981  soap->mode &= ~SOAP_ENC_ZLIB;
7982  memcpy(soap->buf, soap->z_buf, SOAP_BUFLEN);
7983  soap->bufidx = (char*)soap->d_stream->next_in - soap->z_buf;
7984  soap->buflen = soap->z_buflen;
7986 
7987  if (inflateEnd(soap->d_stream) != Z_OK)
7988  return soap->error = SOAP_ZLIB_ERROR;
7989 
7990  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate end ok\n"));
7991 #ifdef WITH_GZIP
7992 
7993  if (soap->zlib_in == SOAP_ZLIB_GZIP)
7994  {
7995  soap_wchar c;
7996  short i;
7997  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate gzip crc check\n"));
7998 
7999  for (i = 0; i < 8; i++)
8000  {
8001  if ((int)(c = soap_get1(soap)) == EOF)
8002  return soap->error = SOAP_EOF;
8003 
8004  soap->z_buf[i] = (char)c;
8005  }
8006 
8007  if (soap->z_crc != ((uLong)(unsigned char)soap->z_buf[0] | ((uLong)(unsigned char)soap->z_buf[1] << 8) | ((uLong)(unsigned char)soap->z_buf[2] << 16) | ((uLong)(unsigned char)soap->z_buf[3] << 24)))
8008  {
8009  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip error: crc check failed, message corrupted? (crc32=%lu)\n", (unsigned long)soap->z_crc));
8010  return soap->error = SOAP_ZLIB_ERROR;
8011  }
8012 
8013  if (soap->d_stream->total_out != ((uLong)(unsigned char)soap->z_buf[4] | ((uLong)(unsigned char)soap->z_buf[5] << 8) | ((uLong)(unsigned char)soap->z_buf[6] << 16) | ((uLong)(unsigned char)soap->z_buf[7] << 24)))
8014  {
8015  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Gzip error: incorrect message length\n"));
8016  return soap->error = SOAP_ZLIB_ERROR;
8017  }
8018  }
8019 
8021 #endif
8022  }
8023 
8024 #endif
8025 
8026  if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
8027  while ((int)soap_getchar(soap) != EOF) /* advance to last chunk */
8028  ;
8029 
8030  if (soap->fdisconnect && (soap->error = soap->fdisconnect(soap)))
8031  return soap->error;
8032 
8033 #ifndef WITH_NOIDREF
8034 
8035  if (soap_resolve(soap))
8036  return soap->error;
8037 
8038 #endif
8039 #ifndef WITH_LEANER
8040 
8041  if (soap->xlist)
8042  {
8043  if (soap->mode & SOAP_ENC_MTOM)
8044  return soap->error = SOAP_MIME_HREF;
8045 
8046  return soap->error = SOAP_DIME_HREF;
8047  }
8048 
8049 #endif
8050  soap_free_ns(soap);
8051  return SOAP_OK;
8052  }
int error
Definition: stdsoap2.h:1755
struct soap_multipart * first
Definition: stdsoap2.h:1413
struct soap_multipart * list
Definition: stdsoap2.h:1412
short part
Definition: stdsoap2.h:1729
soap_mode mode
Definition: stdsoap2.h:1601
struct soap_multipart * first
Definition: stdsoap2.h:1397
int(* fdisconnect)(struct soap *)
Definition: stdsoap2.h:1651
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1101
#define SOAP_DIME_HREF
Definition: stdsoap2.h:1028
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
#define SOAP_IO
Definition: stdsoap2.h:1086
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_ZLIB_NONE
Definition: stdsoap2.h:1077
#define SOAP_MIME_HREF
Definition: stdsoap2.h:1032
struct soap_multipart * list
Definition: stdsoap2.h:1396
static void soap_resolve_attachment(struct soap *, struct soap_multipart *)
Definition: stdsoap2.cpp:15254
int32_t z_crc
Definition: stdsoap2.h:1823
struct soap_dime dime
Definition: stdsoap2.h:1760
size_t z_buflen
Definition: stdsoap2.h:1829
short zlib_state
Definition: stdsoap2.h:1825
#define SOAP_ZLIB_GZIP
Definition: stdsoap2.h:1080
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
void * d_stream
Definition: stdsoap2.h:1822
char buf[(65536)]
Definition: stdsoap2.h:1710
int soap_getmime(struct soap *soap)
Definition: stdsoap2.cpp:15009
int soap_resolve(struct soap *soap)
Definition: stdsoap2.cpp:2910
soap_wchar soap_getchar(struct soap *soap)
Definition: stdsoap2.cpp:1616
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1102
struct soap_multipart * last
Definition: stdsoap2.h:1397
struct soap_multipart * next
Definition: stdsoap2.h:1441
int soap_getdime(struct soap *soap)
Definition: stdsoap2.cpp:14758
#define SOAP_MIME_POSTCHECK
Definition: stdsoap2.h:1125
struct soap_multipart * last
Definition: stdsoap2.h:1413
size_t bufidx
Definition: stdsoap2.h:1699
#define SOAP_END
Definition: stdsoap2.h:1162
char * boundary
Definition: stdsoap2.h:1410
#define SOAP_OK
Definition: stdsoap2.h:995
short zlib_in
Definition: stdsoap2.h:1826
char * z_buf
Definition: stdsoap2.h:1828
#define soap_get1(soap)
Definition: stdsoap2.h:1893
struct soap_xlist * xlist
Definition: stdsoap2.h:1762
#define SOAP_ZLIB_ERROR
Definition: stdsoap2.h:1026
struct soap_mime mime
Definition: stdsoap2.h:1761
#define SOAP_EOF
Definition: stdsoap2.h:993
if(!yymsg) yymsg
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
int32_t soap_wchar
Definition: stdsoap2.h:1257
size_t buflen
Definition: stdsoap2.h:1700
static void soap_free_ns(struct soap *soap)
Definition: stdsoap2.cpp:8135
int soap_end_send ( struct soap )

Definition at line 7748 of file stdsoap2.cpp.

References soap::action, soap::blist, soap::count, soap::d_stream, DBGLOG, DBGMSG, soap::dime, soap::endpoint, soap::error, soap_dime::first, soap_mime::first, soap::fpost, soap::fresponse, soap::fsend, soap::fshutdownsocket, soap::host, soap::keep_alive, soap_dime::last, soap_mime::last, soap_dime::list, soap_mime::list, soap::mime, soap::mode, soap_multipart::next, soap::omode, soap::part, soap::path, soap::port, soap_blist::size, soap_block_size(), SOAP_BUFLEN, SOAP_ENC_XML, SOAP_ENC_ZLIB, SOAP_END, soap_end_block(), soap_first_block(), soap_flush(), soap_flush_raw(), SOAP_IO, SOAP_IO_CHUNK, SOAP_IO_STORE, SOAP_IO_UDP, soap_next_block(), SOAP_OK, SOAP_POST, soap_putdime(), soap_putmime(), SOAP_STOP, SOAP_STR_EOS, soap_valid_socket, SOAP_XML_SEC, SOAP_ZLIB_DEFLATE, SOAP_ZLIB_ERROR, SOAP_ZLIB_NONE, soap::socket, soap::ssl, soap::status, soap::z_buf, soap::z_crc, soap::z_ratio_out, soap::zlib_out, and soap::zlib_state.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), soap_send_empty_response(), soap_send_fault(), and soap_try_connect_command().

7749  {
7750 #ifndef WITH_LEANER
7751 
7752  if (soap->dime.list)
7753  {/* SOAP body referenced attachments must appear first */
7754  soap->dime.last->next = soap->dime.first;
7755  soap->dime.first = soap->dime.list->next;
7756  soap->dime.list->next = NULL;
7757  soap->dime.last = soap->dime.list;
7758  }
7759 
7761  return soap->error;
7762 
7763  soap->mime.list = NULL;
7764  soap->mime.first = NULL;
7765  soap->mime.last = NULL;
7766  soap->dime.list = NULL;
7767  soap->dime.first = NULL;
7768  soap->dime.last = NULL;
7769 #endif
7770  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End send\n"));
7771 
7772  if (soap->mode & SOAP_IO) /* need to flush the remaining data in buffer */
7773  {
7774  if (soap_flush(soap))
7775 #ifdef WITH_ZLIB
7776 
7778  {
7780  deflateEnd(soap->d_stream);
7781  }
7782 
7783  return soap->error;
7784  }
7785 #else
7786  return soap->error;
7787 #endif
7788 #ifdef WITH_ZLIB
7789 
7790  if (soap->mode & SOAP_ENC_ZLIB)
7791  {
7792  int r;
7793  soap->d_stream->avail_in = 0;
7794 
7795  do
7796  {
7797  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating remainder\n"));
7798  r = deflate(soap->d_stream, Z_FINISH);
7799 
7800  if (soap->d_stream->avail_out != SOAP_BUFLEN)
7801  {
7802  if (soap_flush_raw(soap, soap->z_buf, SOAP_BUFLEN - soap->d_stream->avail_out))
7803  {
7805  deflateEnd(soap->d_stream);
7806  return soap->error;
7807  }
7808 
7809  soap->d_stream->next_out = (Byte*)soap->z_buf;
7810  soap->d_stream->avail_out = SOAP_BUFLEN;
7811  }
7812  }
7813  while (r == Z_OK);
7814 
7815  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflated total %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out));
7816  soap->z_ratio_out = (float)soap->d_stream->total_out / (float)soap->d_stream->total_in;
7817  soap->mode &= ~SOAP_ENC_ZLIB;
7819 
7820  if (deflateEnd(soap->d_stream) != Z_OK || r != Z_STREAM_END)
7821  {
7822  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to end deflate: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS));
7823  return soap->error = SOAP_ZLIB_ERROR;
7824  }
7825 
7826 #ifdef WITH_GZIP
7827 
7829  {
7830  soap->z_buf[0] = soap->z_crc & 0xFF;
7831  soap->z_buf[1] = (soap->z_crc >> 8) & 0xFF;
7832  soap->z_buf[2] = (soap->z_crc >> 16) & 0xFF;
7833  soap->z_buf[3] = (soap->z_crc >> 24) & 0xFF;
7834  soap->z_buf[4] = soap->d_stream->total_in & 0xFF;
7835  soap->z_buf[5] = (soap->d_stream->total_in >> 8) & 0xFF;
7836  soap->z_buf[6] = (soap->d_stream->total_in >> 16) & 0xFF;
7837  soap->z_buf[7] = (soap->d_stream->total_in >> 24) & 0xFF;
7838 
7839  if (soap_flush_raw(soap, soap->z_buf, 8))
7840  return soap->error;
7841 
7842  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip crc32=%lu\n", (unsigned long)soap->z_crc));
7843  }
7844 
7845 #endif
7846  }
7847 
7848 #endif
7849 
7850  if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
7851  {
7852  char *p;
7853 #ifndef WITH_NOHTTP
7854 
7855  if (!(soap->mode & SOAP_ENC_XML))
7856  {
7857  soap->mode--;
7858  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending buffered message of length %u\n", (unsigned int)soap->blist->size));
7859 
7860  if (soap->status >= SOAP_POST)
7862  else if (soap->status != SOAP_STOP)
7864 
7865  if (soap->error || soap_flush(soap))
7866  return soap->error;
7867 
7868  soap->mode++;
7869  }
7870 
7871 #endif
7872 
7873  for (p = soap_first_block(soap, NULL); p; p = soap_next_block(soap, NULL))
7874  {
7875  DBGMSG(SENT, p, soap_block_size(soap, NULL));
7876 
7877  if ((soap->error = soap->fsend(soap, p, soap_block_size(soap, NULL))))
7878  {
7879  soap_end_block(soap, NULL);
7880  return soap->error;
7881  }
7882  }
7883 
7884  soap_end_block(soap, NULL);
7885  }
7886 
7887 #ifndef WITH_LEANER
7888  else if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
7889  {
7890  DBGMSG(SENT, "\r\n0\r\n\r\n", 7);
7891 
7892  if ((soap->error = soap->fsend(soap, "\r\n0\r\n\r\n", 7)))
7893  return soap->error;
7894  }
7895 
7896 #endif
7897  }
7898 
7899 #ifdef WITH_TCPFIN
7900 #ifdef WITH_OPENSSL
7901 
7903  soap->fshutdownsocket(soap, soap->socket, 1); /* Send TCP FIN */
7904 
7905 #else
7906 
7908  soap->fshutdownsocket(soap, soap->socket, 1); /* Send TCP FIN */
7909 
7910 #endif
7911 #endif
7912  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of send phase\n"));
7913  soap->omode &= ~SOAP_XML_SEC;
7914  soap->count = 0;
7915  soap->part = SOAP_END;
7916  return SOAP_OK;
7917  }
char path[(1024)]
Definition: stdsoap2.h:1735
short keep_alive
Definition: stdsoap2.h:1742
struct soap_blist * blist
Definition: stdsoap2.h:1624
char * soap_next_block(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3092
int error
Definition: stdsoap2.h:1755
struct soap_multipart * first
Definition: stdsoap2.h:1413
struct soap_multipart * list
Definition: stdsoap2.h:1412
#define soap_valid_socket(n)
Definition: stdsoap2.h:698
int soap_flush_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:915
short part
Definition: stdsoap2.h:1729
char * action
Definition: stdsoap2.h:1737
#define SOAP_POST
Definition: stdsoap2.h:1063
soap_mode mode
Definition: stdsoap2.h:1601
size_t soap_block_size(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3120
struct soap_multipart * first
Definition: stdsoap2.h:1397
int(* fpost)(struct soap *, const char *, const char *, int, const char *, const char *, size_t)
Definition: stdsoap2.h:1638
#define DBGMSG(DBGFILE, MSG, LEN)
Definition: stdsoap2.h:1248
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
#define SOAP_IO_UDP
Definition: stdsoap2.h:1092
#define SOAP_IO
Definition: stdsoap2.h:1086
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_ZLIB_NONE
Definition: stdsoap2.h:1077
struct soap_multipart * list
Definition: stdsoap2.h:1396
int32_t z_crc
Definition: stdsoap2.h:1823
struct soap_dime dime
Definition: stdsoap2.h:1760
short zlib_state
Definition: stdsoap2.h:1825
#define SOAP_ZLIB_DEFLATE
Definition: stdsoap2.h:1078
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
int soap_putdime(struct soap *soap)
Definition: stdsoap2.cpp:14522
void * d_stream
Definition: stdsoap2.h:1822
float z_ratio_out
Definition: stdsoap2.h:1832
int(* fshutdownsocket)(struct soap *, int, int)
Definition: stdsoap2.h:1653
size_t size
Definition: stdsoap2.h:1283
#define SOAP_STOP
Definition: stdsoap2.h:1056
#define SOAP_XML_SEC
Definition: stdsoap2.h:1114
soap_mode omode
Definition: stdsoap2.h:1603
void * ssl
Definition: stdsoap2.h:1799
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1102
char * soap_first_block(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3058
struct soap_multipart * last
Definition: stdsoap2.h:1397
struct soap_multipart * next
Definition: stdsoap2.h:1441
char host[(1024)]
Definition: stdsoap2.h:1736
struct soap_multipart * last
Definition: stdsoap2.h:1413
#define SOAP_END
Definition: stdsoap2.h:1162
int(* fsend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1657
int port
Definition: stdsoap2.h:1741
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
char * z_buf
Definition: stdsoap2.h:1828
int status
Definition: stdsoap2.h:1754
int(* fresponse)(struct soap *, int, size_t)
Definition: stdsoap2.h:1645
#define SOAP_IO_STORE
Definition: stdsoap2.h:1089
#define SOAP_ZLIB_ERROR
Definition: stdsoap2.h:1026
#define SOAP_ENC_XML
Definition: stdsoap2.h:1098
struct soap_mime mime
Definition: stdsoap2.h:1761
int socket
Definition: stdsoap2.h:1684
char endpoint[(1024)]
Definition: stdsoap2.h:1734
void soap_end_block(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3134
int soap_putmime(struct soap *soap)
Definition: stdsoap2.cpp:15330
int soap_flush(struct soap *soap)
Definition: stdsoap2.cpp:863
short zlib_out
Definition: stdsoap2.h:1827
size_t count
Definition: stdsoap2.h:1705
struct soap_ilist* soap_enter ( struct soap ,
const char *   
)

Definition at line 7056 of file stdsoap2.cpp.

References soap_ilist::id, soap::iht, soap_ilist::next, soap_hash(), and SOAP_MALLOC.

Referenced by soap_id_enter(), soap_id_forward(), and soap_id_lookup().

7057  {
7058  register size_t h;
7059  register struct soap_ilist *ip;
7060  ip = (struct soap_ilist*)SOAP_MALLOC(soap, sizeof(struct soap_ilist) + strlen(id));
7061 
7062  if (ip)
7063  {
7064  h = soap_hash(id);
7065  strcpy(ip->id, id);
7066  ip->next = soap->iht[h];
7067  soap->iht[h] = ip;
7068  }
7069 
7070  return ip;
7071  }
struct soap_ilist * next
Definition: stdsoap2.h:1867
char id[1]
Definition: stdsoap2.h:1875
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
struct soap_ilist * iht[(1999)]
Definition: stdsoap2.h:1627
size_t soap_hash(register const char *s)
Definition: stdsoap2.cpp:6152
int soap_envelope_begin_in ( struct soap )

Definition at line 17576 of file stdsoap2.cpp.

References soap::error, soap::local_namespaces, Namespace::ns, Namespace::out, soap::part, soap_element_begin_in(), SOAP_FREE, SOAP_IN_ENVELOPE, SOAP_MALLOC, SOAP_OK, SOAP_TAG_MISMATCH, SOAP_VERSIONMISMATCH, soap::status, and soap::version.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), and MiriamWebServicesSoapBindingProxy::isDeprecated().

17577  {
17578  register struct Namespace *p;
17580 
17581  if (soap_element_begin_in(soap, "SOAP-ENV:Envelope", 0, NULL))
17582  {
17583  if (soap->error == SOAP_TAG_MISMATCH
17584  && !soap_element_begin_in(soap, "Envelope", 0, NULL))
17586  else if (soap->status)
17587  soap->error = soap->status;
17588 
17589  return soap->error;
17590  }
17591 
17592  p = soap->local_namespaces;
17593 
17594  if (p)
17595  {
17596  const char *ns = p[0].out;
17597 
17598  if (!ns)
17599  ns = p[0].ns;
17600 
17601  if (!strcmp(ns, soap_env1))
17602  {
17603  soap->version = 1; /* make sure we use SOAP 1.1 */
17604 
17605  if (p[1].out)
17606  SOAP_FREE(soap, p[1].out);
17607 
17608  if ((p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc1))))
17609  strcpy(p[1].out, soap_enc1);
17610  }
17611  else if (!strcmp(ns, soap_env2))
17612  {
17613  soap->version = 2; /* make sure we use SOAP 1.2 */
17614 
17615  if (p[1].out)
17616  SOAP_FREE(soap, p[1].out);
17617 
17618  if ((p[1].out = (char*)SOAP_MALLOC(soap, sizeof(soap_enc2))))
17619  strcpy(p[1].out, soap_enc2);
17620  }
17621  }
17622 
17623  return SOAP_OK;
17624  }
int error
Definition: stdsoap2.h:1755
static const char soap_enc2[40]
Definition: stdsoap2.cpp:287
short part
Definition: stdsoap2.h:1729
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
static const char soap_env1[42]
Definition: stdsoap2.cpp:284
short version
Definition: stdsoap2.h:1600
static const char soap_env2[40]
Definition: stdsoap2.cpp:286
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
char * out
Definition: stdsoap2.h:1265
#define SOAP_VERSIONMISMATCH
Definition: stdsoap2.h:1034
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
const char * ns
Definition: stdsoap2.h:1263
#define SOAP_IN_ENVELOPE
Definition: stdsoap2.h:1155
static const char soap_enc1[42]
Definition: stdsoap2.cpp:285
#define SOAP_TAG_MISMATCH
Definition: stdsoap2.h:998
#define SOAP_OK
Definition: stdsoap2.h:995
int status
Definition: stdsoap2.h:1754
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
int soap_envelope_begin_out ( struct soap )

Definition at line 17406 of file stdsoap2.cpp.

References soap_mime::boundary, soap::count, soap::dime, soap::error, soap::mime, soap::mode, soap::part, soap_dime::size, soap_element_begin_out(), SOAP_ENC_DIME, SOAP_ENC_MIME, SOAP_ENC_MTOM, SOAP_IN_ENVELOPE, SOAP_IO_LENGTH, soap_putdimehdr(), soap_send_raw(), soap_mime::start, soap::tmpbuf, and soap::version.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_send_fault().

17407  {
17408 #ifndef WITH_LEANER
17409  size_t n = 0;
17410 
17411  if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary && soap->mime.start && strlen(soap->mime.boundary) + strlen(soap->mime.start) < sizeof(soap->tmpbuf) - 80)
17412  {
17413  const char *s;
17414 
17415  if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
17416  s = "application/dime";
17417  else if (soap->version == 2)
17418  {
17419  if (soap->mode & SOAP_ENC_MTOM)
17420  s = "application/xop+xml; charset=utf-8; type=\"application/soap+xml\"";
17421  else
17422  s = "application/soap+xml; charset=utf-8";
17423  }
17424  else if (soap->mode & SOAP_ENC_MTOM)
17425  s = "application/xop+xml; text/xml; charset=utf-8";
17426  else
17427  s = "text/xml; charset=utf-8";
17428 
17429  sprintf(soap->tmpbuf, "--%s\r\nContent-Type: %s\r\nContent-Transfer-Encoding: binary\r\nContent-ID: %s\r\n\r\n", soap->mime.boundary, s, soap->mime.start);
17430  n = strlen(soap->tmpbuf);
17431 
17432  if (soap_send_raw(soap, soap->tmpbuf, n))
17433  return soap->error;
17434  }
17435 
17436  if (soap->mode & SOAP_IO_LENGTH)
17437  soap->dime.size = soap->count; /* DIME in MIME correction */
17438 
17439  if (!(soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME))
17440  {
17441  if (soap_putdimehdr(soap))
17442  return soap->error;
17443  }
17444 
17445 #endif
17447  return soap_element_begin_out(soap, "SOAP-ENV:Envelope", 0, NULL);
17448  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
int error
Definition: stdsoap2.h:1755
short part
Definition: stdsoap2.h:1729
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1101
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
size_t size
Definition: stdsoap2.h:1388
short version
Definition: stdsoap2.h:1600
struct soap_dime dime
Definition: stdsoap2.h:1760
int soap_putdimehdr(struct soap *soap)
Definition: stdsoap2.cpp:14467
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
const char * start
Definition: stdsoap2.h:1411
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
#define SOAP_IN_ENVELOPE
Definition: stdsoap2.h:1155
char * boundary
Definition: stdsoap2.h:1410
struct soap_mime mime
Definition: stdsoap2.h:1761
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
size_t count
Definition: stdsoap2.h:1705
int soap_envelope_end_in ( struct soap )

Definition at line 17632 of file stdsoap2.cpp.

References soap::part, soap_element_end_in(), and SOAP_END_ENVELOPE.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_recv_fault().

17633  {
17635  return soap_element_end_in(soap, "SOAP-ENV:Envelope");
17636  }
short part
Definition: stdsoap2.h:1729
#define SOAP_END_ENVELOPE
Definition: stdsoap2.h:1161
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
int soap_envelope_end_out ( struct soap )

Definition at line 17456 of file stdsoap2.cpp.

References soap::count, soap::dime, soap::dime_id_format, soap::error, soap_dime::first, soap_dime::flags, soap_dime::id, soap::id, soap::local_namespaces, soap::mode, Namespace::ns, soap_dime::options, Namespace::out, soap::part, soap_dime::size, SOAP_DIME_ABSURI, SOAP_DIME_MB, SOAP_DIME_ME, soap_element_end_out(), SOAP_ENC_DIME, SOAP_ENC_MTOM, SOAP_END_ENVELOPE, SOAP_IO_LENGTH, SOAP_OK, soap_send_raw(), SOAP_STR_PADDING, and soap_dime::type.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_send_fault().

17457  {
17458  if (soap_element_end_out(soap, "SOAP-ENV:Envelope"))
17459  return soap->error;
17460 
17461 #ifndef WITH_LEANER
17462 
17463  if ((soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
17464  {
17465  soap->dime.size = soap->count - soap->dime.size; /* DIME in MIME correction */
17466  sprintf(soap->id, soap->dime_id_format, 0);
17467  soap->dime.id = soap->id;
17468 
17469  if (soap->local_namespaces)
17470  {
17471  if (soap->local_namespaces[0].out)
17472  soap->dime.type = (char*)soap->local_namespaces[0].out;
17473  else
17474  soap->dime.type = (char*)soap->local_namespaces[0].ns;
17475  }
17476 
17477  soap->dime.options = NULL;
17479 
17480  if (!soap->dime.first)
17482 
17483  soap->count += 12 + ((strlen(soap->dime.id) + 3) & (~3)) + (soap->dime.type ? ((strlen(soap->dime.type) + 3) & (~3)) : 0);
17484  }
17485 
17486  if ((soap->mode & SOAP_ENC_DIME) && !(soap->mode & SOAP_ENC_MTOM))
17487  return soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime.size&3);
17488 
17489 #endif
17491  return SOAP_OK;
17492  }
#define SOAP_STR_PADDING
Definition: stdsoap2.cpp:309
const char * dime_id_format
Definition: stdsoap2.h:1606
int error
Definition: stdsoap2.h:1755
short part
Definition: stdsoap2.h:1729
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
soap_mode mode
Definition: stdsoap2.h:1601
struct soap_multipart * first
Definition: stdsoap2.h:1397
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1101
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
size_t size
Definition: stdsoap2.h:1388
#define SOAP_END_ENVELOPE
Definition: stdsoap2.h:1161
struct soap_dime dime
Definition: stdsoap2.h:1760
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
const char * options
Definition: stdsoap2.h:1395
char * out
Definition: stdsoap2.h:1265
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
const char * ns
Definition: stdsoap2.h:1263
char id[(1024)]
Definition: stdsoap2.h:1714
const char * type
Definition: stdsoap2.h:1394
#define SOAP_OK
Definition: stdsoap2.h:995
const char * id
Definition: stdsoap2.h:1393
char flags
Definition: stdsoap2.h:1391
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
#define SOAP_DIME_ABSURI
Definition: stdsoap2.h:1073
#define SOAP_DIME_MB
Definition: stdsoap2.h:1070
size_t count
Definition: stdsoap2.h:1705
#define SOAP_DIME_ME
Definition: stdsoap2.h:1069
void soap_fault ( struct soap )

Definition at line 65 of file soapC.cpp.

References soap::fault, soap_default_SOAP_ENV__Code(), soap_default_SOAP_ENV__Fault(), soap_default_SOAP_ENV__Reason(), SOAP_ENV__Fault::SOAP_ENV__Code, SOAP_ENV__Fault::SOAP_ENV__Reason, soap_new_SOAP_ENV__Code(), soap_new_SOAP_ENV__Fault(), soap_new_SOAP_ENV__Reason(), and soap::version.

Referenced by soap_faultcode(), soap_faultdetail(), soap_faultstring(), soap_faultsubcode(), and soap_serializefault().

66 {
67  if (!soap->fault)
68  {
70 
71  if (!soap->fault)
72  return;
73 
75  }
76 
77  if (soap->version == 2 && !soap->fault->SOAP_ENV__Code)
78  {
81  }
82 
83  if (soap->version == 2 && !soap->fault->SOAP_ENV__Reason)
84  {
87  }
88 }
struct SOAP_ENV__Code * soap_new_SOAP_ENV__Code(struct soap *soap, int n)
Definition: soapC.cpp:2737
void soap_default_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *a)
Definition: soapC.cpp:2629
struct SOAP_ENV__Fault * soap_new_SOAP_ENV__Fault(struct soap *soap, int n)
Definition: soapC.cpp:2273
struct SOAP_ENV__Reason * soap_new_SOAP_ENV__Reason(struct soap *soap, int n)
Definition: soapC.cpp:2421
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
short version
Definition: stdsoap2.h:1600
struct SOAP_ENV__Reason * SOAP_ENV__Reason
Definition: soapStub.h:636
void soap_default_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *a)
Definition: soapC.cpp:2074
struct SOAP_ENV__Code * SOAP_ENV__Code
Definition: soapStub.h:635
void soap_default_SOAP_ENV__Reason(struct soap *soap, struct SOAP_ENV__Reason *a)
Definition: soapC.cpp:2325
const char** soap_faultcode ( struct soap )

Definition at line 111 of file soapC.cpp.

References soap::fault, SOAP_ENV__Fault::faultcode, SOAP_ENV__Fault::SOAP_ENV__Code, SOAP_ENV__Code::SOAP_ENV__Value, soap_fault(), and soap::version.

Referenced by http_response(), soap_print_fault(), soap_recv_fault(), soap_set_error(), soap_set_fault(), and soap_sprint_fault().

112 {
113  soap_fault(soap);
114 
115  if (soap->version == 2)
116  return (const char**)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Value;
117 
118  return (const char**)&soap->fault->faultcode;
119 }
char * SOAP_ENV__Value
Definition: soapStub.h:598
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
short version
Definition: stdsoap2.h:1600
struct SOAP_ENV__Code * SOAP_ENV__Code
Definition: soapStub.h:635
void soap_fault(struct soap *soap)
Definition: soapC.cpp:65
char * faultcode
Definition: soapStub.h:631
const char** soap_faultdetail ( struct soap )

Definition at line 149 of file soapC.cpp.

References SOAP_ENV__Detail::__any, SOAP_ENV__Fault::detail, soap::fault, soap_default_SOAP_ENV__Detail(), SOAP_ENV__Fault::SOAP_ENV__Detail, soap_fault(), soap_malloc(), soap_new_SOAP_ENV__Detail(), and soap::version.

Referenced by MiriamWebServicesSoapBindingProxy::soap_fault_detail(), soap_print_fault(), soap_set_error(), and soap_sprint_fault().

150 {
151  soap_fault(soap);
152 
153  if (soap->version == 1)
154  {
155  if (!soap->fault->detail)
156  {
157  soap->fault->detail = (struct SOAP_ENV__Detail*)soap_malloc(soap, sizeof(struct SOAP_ENV__Detail));
159  }
160 
161  return (const char**)&soap->fault->detail->__any;
162  }
163 
164  if (!soap->fault->SOAP_ENV__Detail)
165  {
168  }
169 
170  return (const char**)&soap->fault->SOAP_ENV__Detail->__any;
171 }
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
short version
Definition: stdsoap2.h:1600
struct SOAP_ENV__Detail * detail
Definition: soapStub.h:634
struct SOAP_ENV__Detail * SOAP_ENV__Detail
Definition: soapStub.h:639
void soap_default_SOAP_ENV__Detail(struct soap *soap, struct SOAP_ENV__Detail *a)
Definition: soapC.cpp:2473
void soap_fault(struct soap *soap)
Definition: soapC.cpp:65
struct SOAP_ENV__Detail * soap_new_SOAP_ENV__Detail(struct soap *soap, int n)
Definition: soapC.cpp:2577
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
const char** soap_faultstring ( struct soap )

Definition at line 139 of file soapC.cpp.

References soap::fault, SOAP_ENV__Fault::faultstring, SOAP_ENV__Fault::SOAP_ENV__Reason, SOAP_ENV__Reason::SOAP_ENV__Text, soap_fault(), and soap::version.

Referenced by MiriamWebServicesSoapBindingProxy::soap_fault_string(), soap_print_fault(), soap_set_error(), soap_set_fault(), and soap_sprint_fault().

140 {
141  soap_fault(soap);
142 
143  if (soap->version == 2)
144  return (const char**)&soap->fault->SOAP_ENV__Reason->SOAP_ENV__Text;
145 
146  return (const char**)&soap->fault->faultstring;
147 }
char * SOAP_ENV__Text
Definition: soapStub.h:621
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
short version
Definition: stdsoap2.h:1600
struct SOAP_ENV__Reason * SOAP_ENV__Reason
Definition: soapStub.h:636
char * faultstring
Definition: soapStub.h:632
void soap_fault(struct soap *soap)
Definition: soapC.cpp:65
const char** soap_faultsubcode ( struct soap )

Definition at line 121 of file soapC.cpp.

References soap::fault, SOAP_ENV__Fault::faultcode, soap_default_SOAP_ENV__Code(), SOAP_ENV__Fault::SOAP_ENV__Code, SOAP_ENV__Code::SOAP_ENV__Subcode, SOAP_ENV__Code::SOAP_ENV__Value, soap_fault(), soap_new_SOAP_ENV__Code(), and soap::version.

Referenced by soap_print_fault(), soap_set_error(), soap_set_fault(), and soap_sprint_fault().

122 {
123  soap_fault(soap);
124 
125  if (soap->version == 2)
126  {
128  {
131  }
132 
133  return (const char**)&soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value;
134  }
135 
136  return (const char**)&soap->fault->faultcode;
137 }
struct SOAP_ENV__Code * soap_new_SOAP_ENV__Code(struct soap *soap, int n)
Definition: soapC.cpp:2737
void soap_default_SOAP_ENV__Code(struct soap *soap, struct SOAP_ENV__Code *a)
Definition: soapC.cpp:2629
char * SOAP_ENV__Value
Definition: soapStub.h:598
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
short version
Definition: stdsoap2.h:1600
struct SOAP_ENV__Code * SOAP_ENV__Subcode
Definition: soapStub.h:599
struct SOAP_ENV__Code * SOAP_ENV__Code
Definition: soapStub.h:635
void soap_fault(struct soap *soap)
Definition: soapC.cpp:65
char * faultcode
Definition: soapStub.h:631
void soap_fcopy ( struct soap soap,
int  st,
int  tt,
void p,
size_t  ,
const void q,
size_t  n 
)

Definition at line 7736 of file stdsoap2.cpp.

References DBGLOG.

Referenced by soap_id_forward(), and soap_resolve().

7737  {
7738  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying data type=%d (target type=%d) %p -> %p (%lu bytes)\n", st, tt, q, p, (unsigned long)n));
7739  memcpy(p, q, n);
7740  }
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char* soap_first_block ( struct soap ,
struct soap_blist  
)

Definition at line 3058 of file stdsoap2.cpp.

References soap::blist, DBGLOG, and soap_blist::ptr.

Referenced by soap_end_send(), and soap_save_block().

3059  {
3060  char *p, *q, *r;
3061 
3062  if (!b)
3063  b = soap->blist;
3064 
3065  p = b->ptr;
3066 
3067  if (!p)
3068  return NULL;
3069 
3070  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "First block\n"));
3071  r = NULL;
3072 
3073  do
3074  {
3075  q = *(char**)p;
3076  *(char**)p = r;
3077  r = p;
3078  p = q;
3079  }
3080  while (p);
3081 
3082  b->ptr = r;
3083  return r + sizeof(char*) + sizeof(size_t);
3084  }
struct soap_blist * blist
Definition: stdsoap2.h:1624
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char * ptr
Definition: stdsoap2.h:1282
const char* soap_float2s ( struct soap ,
float   
)

Definition at line 12434 of file stdsoap2.cpp.

References soap::c_locale, soap::float_format, soap_isnan, soap_isninff, soap_ispinff, and soap::tmpbuf.

Referenced by soap_outfloat().

12435  {
12436  char *s;
12437 
12438  if (soap_isnan((double)n))
12439  return "NaN";
12440 
12441  if (soap_ispinff(n))
12442  return "INF";
12443 
12444  if (soap_isninff(n))
12445  return "-INF";
12446 
12447  s = soap->tmpbuf;
12448 #if defined(HAVE_SPRINTF_L)
12449  sprintf_l(s, soap->c_locale, soap->float_format, n);
12450 #else
12451  sprintf(s, soap->float_format, n);
12452  s = strchr(s, ','); /* convert decimal comma to DP */
12453 
12454  if (s)
12455  *s = '.';
12456 
12457 #endif
12458  return soap->tmpbuf;
12459  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
#define soap_isnan(n)
Definition: stdsoap2.h:982
void * c_locale
Definition: stdsoap2.h:1816
#define soap_isninff(n)
Definition: stdsoap2.h:989
#define soap_ispinff(n)
Definition: stdsoap2.h:987
const char * float_format
Definition: stdsoap2.h:1604
int soap_flush ( struct soap )

Definition at line 863 of file stdsoap2.cpp.

References soap::buf, soap::bufidx, soap::d_stream, DBGLOG, soap::error, soap::mode, SOAP_BUFLEN, SOAP_ENC_ZLIB, soap_flush_raw(), SOAP_OK, SOAP_STR_EOS, SOAP_ZLIB_ERROR, soap::z_buf, and soap::z_crc.

Referenced by soap_end_send(), soap_response(), soap_send_raw(), soap_try_connect_command(), and tcp_connect().

864  {
865  register size_t n = soap->bufidx;
866 
867  if (n)
868  {
869  soap->bufidx = 0;
870 #ifdef WITH_ZLIB
871 
872  if (soap->mode & SOAP_ENC_ZLIB)
873  {
874  soap->d_stream->next_in = (Byte*)soap->buf;
875  soap->d_stream->avail_in = (unsigned int)n;
876 #ifdef WITH_GZIP
877  soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)n);
878 #endif
879 
880  do
881  {
882  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating %u bytes\n", soap->d_stream->avail_in));
883 
884  if (deflate(soap->d_stream, Z_NO_FLUSH) != Z_OK)
885  {
886  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to deflate: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS));
887  return soap->error = SOAP_ZLIB_ERROR;
888  }
889 
890  if (!soap->d_stream->avail_out)
891  {
893  return soap->error;
894 
895  soap->d_stream->next_out = (Byte*)soap->z_buf;
896  soap->d_stream->avail_out = SOAP_BUFLEN;
897  }
898  }
899  while (soap->d_stream->avail_in);
900  }
901  else
902 #endif
903  return soap_flush_raw(soap, soap->buf, n);
904  }
905 
906  return SOAP_OK;
907  }
int error
Definition: stdsoap2.h:1755
int soap_flush_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:915
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int32_t z_crc
Definition: stdsoap2.h:1823
void * d_stream
Definition: stdsoap2.h:1822
char buf[(65536)]
Definition: stdsoap2.h:1710
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1102
size_t bufidx
Definition: stdsoap2.h:1699
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
char * z_buf
Definition: stdsoap2.h:1828
#define SOAP_ZLIB_ERROR
Definition: stdsoap2.h:1026
int soap_flush_raw ( struct soap ,
const char *  ,
size_t   
)

Definition at line 915 of file stdsoap2.cpp.

References soap::chunksize, DBGMSG, soap::error, soap::fpreparesend, soap::fsend, soap::mode, SOAP_EOM, SOAP_IO, SOAP_IO_CHUNK, SOAP_IO_STORE, SOAP_OK, and soap_push_block().

Referenced by soap_end_send(), soap_flush(), and soap_send_raw().

916  {
917  if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
918  {
919  register char *t;
920 
921  if (!(t = (char*)soap_push_block(soap, NULL, n)))
922  return soap->error = SOAP_EOM;
923 
924  memcpy(t, s, n);
925 #ifndef WITH_LEANER
926 
927  if (soap->fpreparesend)
928  return soap->error = soap->fpreparesend(soap, s, n);
929 
930 #endif
931  return SOAP_OK;
932  }
933 
934 #ifndef WITH_LEANER
935 
936  if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
937  {
938  char t[16];
939  sprintf(t, "\r\n%lX\r\n" + (soap->chunksize ? 0 : 2), (unsigned long)n);
940  DBGMSG(SENT, t, strlen(t));
941 
942  if ((soap->error = soap->fsend(soap, t, strlen(t))))
943  return soap->error;
944 
945  soap->chunksize += n;
946  }
947 
948  DBGMSG(SENT, s, n);
949 #endif
950  return soap->error = soap->fsend(soap, s, n);
951  }
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define DBGMSG(DBGFILE, MSG, LEN)
Definition: stdsoap2.h:1248
size_t chunksize
Definition: stdsoap2.h:1732
#define SOAP_IO
Definition: stdsoap2.h:1086
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
int(* fpreparesend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1667
int(* fsend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1657
#define SOAP_OK
Definition: stdsoap2.h:995
void * soap_push_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:2752
#define SOAP_IO_STORE
Definition: stdsoap2.h:1089
#define SOAP_EOM
Definition: stdsoap2.h:1015
void soap_free ( struct soap )

Definition at line 6224 of file stdsoap2.cpp.

References soap_done().

6225  {
6226  soap_done(soap);
6227  free(soap);
6228  }
void soap_done(struct soap *soap)
Definition: stdsoap2.cpp:4320
void soap_free_temp ( struct soap )

Definition at line 8060 of file stdsoap2.cpp.

References soap::attributes, soap::blist, DBGLOG, soap::encodingStyle, Namespace::id, soap::labbuf, soap::labidx, soap::lablen, soap::local_namespaces, soap_attribute::next, soap_xlist::next, Namespace::ns, Namespace::out, soap_end_block(), SOAP_FREE, soap_free_iht(), soap_free_ns(), soap_free_pht(), SOAP_STR_EOS, soap_attribute::value, and soap::xlist.

Referenced by soap_begin(), soap_begin_recv(), soap_done(), and soap_end().

8061  {
8062  register struct soap_attribute *tp, *tq;
8063  register struct Namespace *ns;
8064  soap_free_ns(soap);
8065  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free any remaining temp blocks\n"));
8066 
8067  while (soap->blist)
8068  soap_end_block(soap, NULL);
8069 
8070  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free attribute storage\n"));
8071 
8072  for (tp = soap->attributes; tp; tp = tq)
8073  {
8074  tq = tp->next;
8075 
8076  if (tp->value)
8077  SOAP_FREE(soap, tp->value);
8078 
8079  SOAP_FREE(soap, tp);
8080  }
8081 
8082  soap->attributes = NULL;
8083 #ifdef WITH_FAST
8084 
8085  if (soap->labbuf)
8087 
8088  soap->labbuf = NULL;
8089  soap->lablen = 0;
8090  soap->labidx = 0;
8091 #endif
8092  ns = soap->local_namespaces;
8093 
8094  if (ns)
8095  {
8096  for (; ns->id; ns++)
8097  {
8098  if (ns->out)
8099  {
8100  if (soap->encodingStyle == ns->out)
8102 
8103  SOAP_FREE(soap, ns->out);
8104  ns->out = NULL;
8105  }
8106 
8107  if (soap->encodingStyle == ns->ns)
8109  }
8110 
8112  soap->local_namespaces = NULL;
8113  }
8114 
8115 #ifndef WITH_LEANER
8116 
8117  while (soap->xlist)
8118  {
8119  struct soap_xlist *xp = soap->xlist->next;
8120  SOAP_FREE(soap, soap->xlist);
8121  soap->xlist = xp;
8122  }
8123 
8124 #endif
8125 #ifndef WITH_NOIDREF
8128 #endif
8129  }
size_t lablen
Definition: stdsoap2.h:1708
struct soap_blist * blist
Definition: stdsoap2.h:1624
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_attribute * next
Definition: stdsoap2.h:1337
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
char * out
Definition: stdsoap2.h:1265
const char * ns
Definition: stdsoap2.h:1263
static void soap_free_iht(struct soap *)
Definition: stdsoap2.cpp:7004
size_t labidx
Definition: stdsoap2.h:1709
static void soap_free_pht(struct soap *)
Definition: stdsoap2.cpp:6246
char * labbuf
Definition: stdsoap2.h:1707
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
struct soap_xlist * next
Definition: stdsoap2.h:1460
struct soap_xlist * xlist
Definition: stdsoap2.h:1762
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
void soap_end_block(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3134
const char * id
Definition: stdsoap2.h:1262
static void soap_free_ns(struct soap *soap)
Definition: stdsoap2.cpp:8135
const char * encodingStyle
Definition: stdsoap2.h:1609
char * value
Definition: stdsoap2.h:1338
soap_wchar soap_get ( struct soap )

Definition at line 1856 of file stdsoap2.cpp.

References soap::ahead, soap::cdata, SOAP_AP, soap_blank, soap_char(), soap_get0, soap_get1, soap_get_pi(), SOAP_GT, SOAP_LT, SOAP_QT, soap_revget1, SOAP_TT, and soap_unget.

Referenced by soap_element_end_in(), soap_getattrval(), soap_getbase64(), soap_gethex(), soap_getutf8(), soap_inliteral(), soap_inwliteral(), soap_string_in(), and soap_value().

1857  {
1858  register soap_wchar c;
1859  c = soap->ahead;
1860 
1861  if (c)
1862  {
1863  if ((int)c != EOF)
1864  soap->ahead = 0;
1865  }
1866  else
1867  c = soap_get1(soap);
1868 
1869  while ((int)c != EOF)
1870  {
1871  if (soap->cdata)
1872  {
1873  if (c == ']')
1874  {
1875  c = soap_get1(soap);
1876 
1877  if (c == ']')
1878  {
1879  c = soap_get0(soap);
1880 
1881  if (c == '>')
1882  {
1883  soap->cdata = 0;
1884  soap_get1(soap);
1885  c = soap_get1(soap);
1886  }
1887  else
1888  {
1889  soap_unget(soap, ']');
1890  return ']';
1891  }
1892  }
1893  else
1894  {
1895  soap_revget1(soap);
1896  return ']';
1897  }
1898  }
1899  else
1900  return c;
1901  }
1902 
1903  switch (c)
1904  {
1905  case '<':
1906 
1907  do c = soap_get1(soap);
1908 
1909  while (soap_blank(c));
1910 
1911  if (c == '!' || c == '?' || c == '%')
1912  {
1913  register int k = 1;
1914 
1915  if (c == '!')
1916  {
1917  c = soap_get1(soap);
1918 
1919  if (c == '[')
1920  {
1921  do c = soap_get1(soap);
1922 
1923  while ((int)c != EOF && c != '[');
1924 
1925  if ((int)c == EOF)
1926  break;
1927 
1928  soap->cdata = 1;
1929  c = soap_get1(soap);
1930  continue;
1931  }
1932 
1933  if (c == '-' && (c = soap_get1(soap)) == '-')
1934  {
1935  do
1936  {
1937  c = soap_get1(soap);
1938 
1939  if (c == '-' && (c = soap_get1(soap)) == '-')
1940  break;
1941  }
1942  while ((int)c != EOF);
1943  }
1944  }
1945  else if (c == '?')
1946  c = soap_get_pi(soap);
1947 
1948  while ((int)c != EOF)
1949  {
1950  if (c == '<')
1951  k++;
1952  else if (c == '>')
1953  {
1954  if (--k <= 0)
1955  break;
1956  }
1957 
1958  c = soap_get1(soap);
1959  }
1960 
1961  if ((int)c == EOF)
1962  break;
1963 
1964  c = soap_get1(soap);
1965  continue;
1966  }
1967 
1968  if (c == '/')
1969  return SOAP_TT;
1970 
1971  soap_revget1(soap);
1972  return SOAP_LT;
1973  case '>':
1974  return SOAP_GT;
1975  case '"':
1976  return SOAP_QT;
1977  case '\'':
1978  return SOAP_AP;
1979  case '&':
1980  return soap_char(soap) | 0x80000000;
1981  }
1982 
1983  break;
1984  }
1985 
1986  return c;
1987  }
static soap_wchar soap_char(struct soap *)
Definition: stdsoap2.cpp:1773
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
soap_wchar ahead
Definition: stdsoap2.h:1701
#define soap_blank(c)
Definition: stdsoap2.cpp:118
#define soap_revget1(soap)
Definition: stdsoap2.h:1899
#define SOAP_TT
Definition: stdsoap2.cpp:113
short cdata
Definition: stdsoap2.h:1702
#define SOAP_QT
Definition: stdsoap2.cpp:115
#define SOAP_GT
Definition: stdsoap2.cpp:114
#define SOAP_AP
Definition: stdsoap2.cpp:116
#define soap_get1(soap)
Definition: stdsoap2.h:1893
#define soap_get0(soap)
Definition: stdsoap2.h:1892
#define SOAP_LT
Definition: stdsoap2.cpp:112
static soap_wchar soap_get_pi(struct soap *)
Definition: stdsoap2.cpp:1993
int32_t soap_wchar
Definition: stdsoap2.h:1257
const char* soap_get_header_attribute ( struct soap ,
const char *  ,
const char *   
)

Definition at line 17301 of file stdsoap2.cpp.

References soap_decode_key(), soap_decode_val(), soap_tag_cmp(), and soap::tmpbuf.

Referenced by http_parse_header(), soap_begin_recv(), and soap_getmimehdr().

17302  {
17303  register const char *s = line;
17304 
17305  if (s)
17306  {
17307  while (*s)
17308  {
17309  register short flag;
17310  s = soap_decode_key(soap->tmpbuf, sizeof(soap->tmpbuf), s);
17311  flag = soap_tag_cmp(soap->tmpbuf, key);
17312  s = soap_decode_val(soap->tmpbuf, sizeof(soap->tmpbuf), s);
17313 
17314  if (!flag)
17315  return soap->tmpbuf;
17316  }
17317  }
17318 
17319  return NULL;
17320  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
const char * soap_decode_val(char *buf, size_t len, const char *val)
Definition: stdsoap2.cpp:17343
int soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:3657
const char * soap_decode_key(char *buf, size_t len, const char *val)
Definition: stdsoap2.cpp:17330
long int flag
Definition: f2c.h:52
struct soap_multipart* soap_get_mime_attachment ( struct soap soap,
void handle 
)

Definition at line 15054 of file stdsoap2.cpp.

References soap_mime::boundary, DBGLOG, soap_multipart::description, soap_multipart::encoding, soap::error, soap_mime::first, soap::fmimewrite, soap::fmimewriteclose, soap::fmimewriteopen, soap_multipart::id, soap_mime::last, soap::mime, soap::mode, soap::msgbuf, soap_multipart::ptr, soap_multipart::size, soap_blank, SOAP_ENC_MIME, soap_end_recv(), SOAP_EOF, SOAP_EOM, soap_get1, soap_getchar(), soap_getmimehdr(), SOAP_MIME_ERROR, SOAP_MIME_POSTCHECK, soap_new_block(), soap_push_block(), soap_resolve_attachment(), soap_save_block(), soap_size_block(), SOAP_STR_EOS, soap::tmpbuf, and soap_multipart::type.

Referenced by soap_begin_recv(), soap_check_mime_attachments(), and soap_getmime().

15055  {
15056  register soap_wchar c = 0;
15057  register size_t i, m = 0;
15058  register char *s, *t = NULL;
15059  register struct soap_multipart *content;
15060  register short flag = 0;
15061 
15062  if (!(soap->mode & SOAP_ENC_MIME))
15063  return NULL;
15064 
15065  content = soap->mime.last;
15066 
15067  if (!content)
15068  {
15069  if (soap_getmimehdr(soap))
15070  return NULL;
15071 
15072  content = soap->mime.last;
15073  }
15074  else if (content != soap->mime.first)
15075  {
15076  if (soap->fmimewriteopen && ((content->ptr = (char*)soap->fmimewriteopen(soap, (void*)handle, content->id, content->type, content->description, content->encoding)) || soap->error))
15077  {
15078  if (!content->ptr)
15079  return NULL;
15080  }
15081  }
15082 
15083  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Parsing MIME content id=%s type=%s\n", content->id ? content->id : SOAP_STR_EOS, content->type ? content->type : SOAP_STR_EOS));
15084 
15085  if (!content->ptr && soap_new_block(soap) == NULL)
15086  {
15087  soap->error = SOAP_EOM;
15088  return NULL;
15089  }
15090 
15091  for (;;)
15092  {
15093  if (content->ptr)
15094  s = soap->tmpbuf;
15095  else if (!(s = (char*)soap_push_block(soap, NULL, sizeof(soap->tmpbuf))))
15096  {
15097  soap->error = SOAP_EOM;
15098  return NULL;
15099  }
15100 
15101  for (i = 0; i < sizeof(soap->tmpbuf); i++)
15102  {
15103  if (m > 0)
15104  {
15105  *s++ = *t++;
15106  m--;
15107  }
15108  else
15109  {
15110  if (!flag)
15111  {
15112  c = soap_get1(soap);
15113 
15114  if ((int)c == EOF)
15115  {
15116  soap->error = SOAP_EOF;
15117  return NULL;
15118  }
15119  }
15120 
15121  if (flag || c == '\r')
15122  {
15123  t = soap->msgbuf;
15124  memset(t, 0, sizeof(soap->msgbuf));
15125  strcpy(t, "\n--");
15126 
15127  if (soap->mime.boundary)
15128  strncat(t, soap->mime.boundary, sizeof(soap->msgbuf) - 4);
15129 
15130  do c = soap_getchar(soap);
15131 
15132  while (c == *t++);
15133 
15134  if ((int)c == EOF)
15135  {
15136  soap->error = SOAP_EOF;
15137  return NULL;
15138  }
15139 
15140  if (!*--t)
15141  goto end;
15142 
15143  *t = (char)c;
15144  flag = (c == '\r');
15145  m = t - soap->msgbuf + 1 - flag;
15146  t = soap->msgbuf;
15147  c = '\r';
15148  }
15149 
15150  *s++ = (char)c;
15151  }
15152  }
15153 
15154  if (content->ptr && soap->fmimewrite)
15155  {
15156  if ((soap->error = soap->fmimewrite(soap, (void*)content->ptr, soap->tmpbuf, i)))
15157  break;
15158  }
15159  }
15160 
15161 end:
15162  *s = '\0'; /* force 0-terminated */
15163 
15164  if (content->ptr)
15165  {
15166  if (!soap->error && soap->fmimewrite)
15167  soap->error = soap->fmimewrite(soap, (void*)content->ptr, soap->tmpbuf, i);
15168 
15169  if (soap->fmimewriteclose)
15170  soap->fmimewriteclose(soap, (void*)content->ptr);
15171 
15172  if (soap->error)
15173  return NULL;
15174  }
15175  else
15176  {
15177  content->size = soap_size_block(soap, NULL, i + 1) - 1;
15178  content->ptr = soap_save_block(soap, NULL, NULL, 0);
15179  }
15180 
15181  soap_resolve_attachment(soap, content);
15182 
15183  if (c == '-' && soap_getchar(soap) == '-')
15184  {
15185  soap->mode &= ~SOAP_ENC_MIME;
15186 
15187  if ((soap->mode & SOAP_MIME_POSTCHECK) && soap_end_recv(soap))
15188  return NULL;
15189  }
15190  else
15191  {
15192  while (c != '\r' && (int)c != EOF && soap_blank(c))
15193  c = soap_getchar(soap);
15194 
15195  if (c != '\r' || soap_getchar(soap) != '\n')
15196  {
15197  soap->error = SOAP_MIME_ERROR;
15198  return NULL;
15199  }
15200 
15201  if (soap_getmimehdr(soap))
15202  return NULL;
15203  }
15204 
15205  return content;
15206  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
char msgbuf[1024]
Definition: stdsoap2.h:1711
const char * id
Definition: stdsoap2.h:1444
int error
Definition: stdsoap2.h:1755
struct soap_multipart * first
Definition: stdsoap2.h:1413
soap_mode mode
Definition: stdsoap2.h:1601
int soap_end_recv(struct soap *soap)
Definition: stdsoap2.cpp:7925
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_MIME_ERROR
Definition: stdsoap2.h:1031
enum soap_mime_encoding encoding
Definition: stdsoap2.h:1447
static void soap_resolve_attachment(struct soap *, struct soap_multipart *)
Definition: stdsoap2.cpp:15254
int soap_getmimehdr(struct soap *soap)
Definition: stdsoap2.cpp:14923
struct soap_blist * soap_new_block(struct soap *soap)
Definition: stdsoap2.cpp:2728
#define soap_blank(c)
Definition: stdsoap2.cpp:118
char * soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
Definition: stdsoap2.cpp:3179
soap_wchar soap_getchar(struct soap *soap)
Definition: stdsoap2.cpp:1616
#define SOAP_MIME_POSTCHECK
Definition: stdsoap2.h:1125
struct soap_multipart * last
Definition: stdsoap2.h:1413
long int flag
Definition: f2c.h:52
char * boundary
Definition: stdsoap2.h:1410
int(* fmimewrite)(struct soap *, void *, const char *, size_t)
Definition: stdsoap2.h:1681
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
void * soap_push_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:2752
const char * description
Definition: stdsoap2.h:1449
size_t soap_size_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:3038
#define soap_get1(soap)
Definition: stdsoap2.h:1893
#define SOAP_EOM
Definition: stdsoap2.h:1015
struct soap_mime mime
Definition: stdsoap2.h:1761
#define SOAP_EOF
Definition: stdsoap2.h:993
const char * type
Definition: stdsoap2.h:1445
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
int32_t soap_wchar
Definition: stdsoap2.h:1257
void(* fmimewriteclose)(struct soap *, void *)
Definition: stdsoap2.h:1679
void *(* fmimewriteopen)(struct soap *, void *, const char *, const char *, const char *, enum soap_mime_encoding)
Definition: stdsoap2.h:1677
unsigned char* soap_getbase64 ( struct soap ,
int *  ,
int   
)

Definition at line 2424 of file stdsoap2.cpp.

References soap_dom_element::data, soap::dom, soap::error, soap::labbuf, soap::labidx, soap::lablen, soap::mode, soap_append_lab(), soap_base642s(), soap_blank, SOAP_BLKLEN, soap_end_block(), soap_get(), SOAP_LT, soap_malloc(), soap_new_block(), soap_push_block(), soap_save_block(), soap_size_block(), soap_string_in(), SOAP_TT, SOAP_TYPE, soap_unget, and SOAP_XML_DOM.

2425  {
2426 #ifdef WITH_DOM
2427 
2428  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
2429  {
2430  soap->dom->data = soap_string_in(soap, 0, -1, -1);
2431  return (unsigned char*)soap_base642s(soap, soap->dom->data, NULL, 0, n);
2432  }
2433 
2434 #endif
2435 #ifdef WITH_FAST
2436  soap->labidx = 0;
2437 
2438  for (;;)
2439  {
2440  register size_t i, k;
2441  register char *s;
2442 
2443  if (soap_append_lab(soap, NULL, 2))
2444  return NULL;
2445 
2446  s = soap->labbuf + soap->labidx;
2447  k = soap->lablen - soap->labidx;
2448  soap->labidx = 3 * (soap->lablen / 3);
2449 
2450  if (!s)
2451  return NULL;
2452 
2453  if (k > 2)
2454  {
2455  for (i = 0; i < k - 2; i += 3)
2456  {
2457  register unsigned long m = 0;
2458  register int j = 0;
2459 
2460  do
2461  {
2462  register soap_wchar c = soap_get(soap);
2463 
2464  if (c == '=' || c < 0)
2465  {
2466  unsigned char *p;
2467 
2468  switch (j)
2469  {
2470  case 2:
2471  *s++ = (char)((m >> 4) & 0xFF);
2472  i++;
2473  break;
2474  case 3:
2475  *s++ = (char)((m >> 10) & 0xFF);
2476  *s++ = (char)((m >> 2) & 0xFF);
2477  i += 2;
2478  }
2479 
2480  if (n)
2481  *n = (int)(soap->lablen + i - k);
2482 
2483  p = (unsigned char*)soap_malloc(soap, soap->lablen + i - k);
2484 
2485  if (p)
2486  memcpy(p, soap->labbuf, soap->lablen + i - k);
2487 
2488  if (c >= 0)
2489  {
2490  while ((int)((c = soap_get(soap)) != EOF) && c != SOAP_LT && c != SOAP_TT)
2491  ;
2492  }
2493 
2494  soap_unget(soap, c);
2495  return p;
2496  }
2497 
2498  c -= '+';
2499 
2500  if (c >= 0 && c <= 79)
2501  {
2502  register int b = soap_base64i[c];
2503 
2504  if (b >= 64)
2505  {
2506  soap->error = SOAP_TYPE;
2507  return NULL;
2508  }
2509 
2510  m = (m << 6) + b;
2511  j++;
2512  }
2513  else if (!soap_blank(c + '+'))
2514  {
2515  soap->error = SOAP_TYPE;
2516  return NULL;
2517  }
2518  }
2519  while (j < 4);
2520 
2521  *s++ = (char)((m >> 16) & 0xFF);
2522  *s++ = (char)((m >> 8) & 0xFF);
2523  *s++ = (char)(m & 0xFF);
2524  }
2525  }
2526  }
2527 
2528 #else
2529 
2530  if (soap_new_block(soap) == NULL)
2531  return NULL;
2532 
2533  for (;;)
2534  {
2535  register int i;
2536  register char *s = (char*)soap_push_block(soap, NULL, 3 * SOAP_BLKLEN); /* must be multiple of 3 */
2537 
2538  if (!s)
2539  {
2540  soap_end_block(soap, NULL);
2541  return NULL;
2542  }
2543 
2544  for (i = 0; i < SOAP_BLKLEN; i++)
2545  {
2546  register unsigned long m = 0;
2547  register int j = 0;
2548 
2549  do
2550  {
2551  register soap_wchar c = soap_get(soap);
2552 
2553  if (c == '=' || c < 0)
2554  {
2555  unsigned char *p;
2556  i *= 3;
2557 
2558  switch (j)
2559  {
2560  case 2:
2561  *s++ = (char)((m >> 4) & 0xFF);
2562  i++;
2563  break;
2564  case 3:
2565  *s++ = (char)((m >> 10) & 0xFF);
2566  *s++ = (char)((m >> 2) & 0xFF);
2567  i += 2;
2568  }
2569 
2570  if (n)
2571  *n = (int)soap_size_block(soap, NULL, i);
2572 
2573  p = (unsigned char*)soap_save_block(soap, NULL, 0);
2574 
2575  if (c >= 0)
2576  {
2577  while ((int)((c = soap_get(soap)) != EOF) && c != SOAP_LT && c != SOAP_TT)
2578  ;
2579  }
2580 
2581  soap_unget(soap, c);
2582  return p;
2583  }
2584 
2585  c -= '+';
2586 
2587  if (c >= 0 && c <= 79)
2588  {
2589  int b = soap_base64i[c];
2590 
2591  if (b >= 64)
2592  {
2593  soap->error = SOAP_TYPE;
2594  return NULL;
2595  }
2596 
2597  m = (m << 6) + b;
2598  j++;
2599  }
2600  else if (!soap_blank(c))
2601  {
2602  soap->error = SOAP_TYPE;
2603  return NULL;
2604  }
2605  }
2606  while (j < 4);
2607 
2608  *s++ = (char)((m >> 16) & 0xFF);
2609  *s++ = (char)((m >> 8) & 0xFF);
2610  *s++ = (char)(m & 0xFF);
2611  }
2612  }
2613 
2614 #endif
2615  }
size_t lablen
Definition: stdsoap2.h:1708
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
soap_wchar soap_get(struct soap *soap)
Definition: stdsoap2.cpp:1856
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
struct soap_blist * soap_new_block(struct soap *soap)
Definition: stdsoap2.cpp:2728
#define soap_blank(c)
Definition: stdsoap2.cpp:118
const char * soap_base642s(struct soap *soap, const char *s, char *t, size_t l, int *n)
Definition: stdsoap2.cpp:18039
char * soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
Definition: stdsoap2.cpp:3179
#define SOAP_TT
Definition: stdsoap2.cpp:113
#define SOAP_BLKLEN
Definition: stdsoap2.h:841
char * soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
Definition: stdsoap2.cpp:11015
size_t labidx
Definition: stdsoap2.h:1709
char * labbuf
Definition: stdsoap2.h:1707
int soap_append_lab(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:10289
void * soap_push_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:2752
size_t soap_size_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:3038
#define SOAP_LT
Definition: stdsoap2.cpp:112
void soap_end_block(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3134
int32_t soap_wchar
Definition: stdsoap2.h:1257
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
static const char soap_base64i[81]
Definition: stdsoap2.cpp:294
soap_wchar soap_getchar ( struct soap )

Definition at line 1616 of file stdsoap2.cpp.

References soap::ahead, and soap_get1.

Referenced by soap_begin_recv(), soap_end_recv(), soap_get_http_body(), soap_get_mime_attachment(), soap_get_pi(), soap_getdimehdr(), soap_getline(), soap_move(), and soap_string_in().

1617  {
1618  register soap_wchar c;
1619  c = soap->ahead;
1620 
1621  if (c)
1622  {
1623  if (c != EOF)
1624  soap->ahead = 0;
1625 
1626  return c;
1627  }
1628 
1629  return soap_get1(soap);
1630  }
soap_wchar ahead
Definition: stdsoap2.h:1701
#define soap_get1(soap)
Definition: stdsoap2.h:1893
int32_t soap_wchar
Definition: stdsoap2.h:1257
int soap_getdime ( struct soap )

Definition at line 14758 of file stdsoap2.cpp.

References soap::blist, soap::buf, soap::bufidx, soap::buflen, soap::dime, soap::error, soap::fdimewrite, soap::fdimewriteclose, soap::fdimewriteopen, soap_dime::first, soap_dime::flags, soap_dime::id, soap_multipart::id, soap_dime::last, soap_dime::options, soap_multipart::options, soap_dime::ptr, soap_blist::size, soap_dime::size, soap_multipart::size, SOAP_DIME_CF, SOAP_DIME_END, SOAP_EOF, SOAP_EOM, soap_get1, soap_getdimefield(), soap_getdimehdr(), soap_move(), soap_new_block(), soap_new_multipart(), SOAP_OK, soap_push_block(), soap_recv(), soap_resolve_attachment(), soap_save_block(), soap_tell(), soap_dime::type, and soap_multipart::type.

Referenced by soap_end_recv().

14759  {
14760  while (soap->dime.flags & SOAP_DIME_CF)
14761  {
14762  if (soap_getdimehdr(soap))
14763  return soap->error;
14764 
14765  if (soap_move(soap, (long)soap->dime.size))
14766  return soap->error = SOAP_EOF;
14767  }
14768 
14769  if (soap_move(soap, (long)(((soap->dime.size + 3)&(~3)) - soap_tell(soap))))
14770  return soap->error = SOAP_EOF;
14771 
14772  for (;;)
14773  {
14774  register struct soap_multipart *content;
14775 
14776  if (soap_getdimehdr(soap))
14777  break;
14778 
14780  {
14781  const char * id, *type, *options;
14782  size_t size, n;
14783 
14784  if (!soap->dime.ptr)
14785  return soap->error;
14786 
14787  id = soap->dime.id;
14788  type = soap->dime.type;
14789  options = soap->dime.options;
14790 
14791  for (;;)
14792  {
14793  size = soap->dime.size;
14794 
14795  for (;;)
14796  {
14797  n = soap->buflen - soap->bufidx;
14798 
14799  if (size < n)
14800  n = size;
14801 
14802  if ((soap->error = soap->fdimewrite(soap, (void*)soap->dime.ptr, soap->buf + soap->bufidx, n)))
14803  break;
14804 
14805  size -= n;
14806 
14807  if (!size)
14808  {
14809  soap->bufidx += n;
14810  break;
14811  }
14812 
14813  if (soap_recv(soap))
14814  {
14815  soap->error = SOAP_EOF;
14816  goto end;
14817  }
14818  }
14819 
14820  if (soap_move(soap, -(long)soap->dime.size&3))
14821  {
14822  soap->error = SOAP_EOF;
14823  break;
14824  }
14825 
14826  if (!(soap->dime.flags & SOAP_DIME_CF))
14827  break;
14828 
14829  if (soap_getdimehdr(soap))
14830  break;
14831  }
14832 
14833 end:
14834 
14835  if (soap->fdimewriteclose)
14836  soap->fdimewriteclose(soap, (void*)soap->dime.ptr);
14837 
14838  soap->dime.size = 0;
14839  soap->dime.id = id;
14840  soap->dime.type = type;
14841  soap->dime.options = options;
14842  }
14843  else if (soap->dime.flags & SOAP_DIME_CF)
14844  {
14845  const char *id, *type, *options;
14846  id = soap->dime.id;
14847  type = soap->dime.type;
14848  options = soap->dime.options;
14849 
14850  if (soap_new_block(soap) == NULL)
14851  return SOAP_EOM;
14852 
14853  for (;;)
14854  {
14855  register soap_wchar c;
14856  register size_t i;
14857  register char *s;
14858  s = (char*)soap_push_block(soap, NULL, soap->dime.size);
14859 
14860  if (!s)
14861  return soap->error = SOAP_EOM;
14862 
14863  for (i = soap->dime.size; i > 0; i--)
14864  {
14865  if ((int)(c = soap_get1(soap)) == EOF)
14866  return soap->error = SOAP_EOF;
14867 
14868  *s++ = (char)c;
14869  }
14870 
14871  if (soap_move(soap, -(long)soap->dime.size&3))
14872  return soap->error = SOAP_EOF;
14873 
14874  if (!(soap->dime.flags & SOAP_DIME_CF))
14875  break;
14876 
14877  if (soap_getdimehdr(soap))
14878  return soap->error;
14879  }
14880 
14881  soap->dime.size = soap->blist->size++; /* allocate one more for '\0' */
14882 
14883  if (!(soap->dime.ptr = soap_save_block(soap, NULL, NULL, 0)))
14884  return soap->error;
14885 
14886  soap->dime.ptr[soap->dime.size] = '\0'; /* force 0-terminated */
14887  soap->dime.id = id;
14888  soap->dime.type = type;
14889  soap->dime.options = options;
14890  }
14891  else
14893 
14895 
14896  if (!content)
14897  return soap->error = SOAP_EOM;
14898 
14899  content->id = soap->dime.id;
14900  content->type = soap->dime.type;
14901  content->options = soap->dime.options;
14902 
14903  if (soap->error)
14904  return soap->error;
14905 
14906  soap_resolve_attachment(soap, content);
14907  }
14908 
14909  if (soap->error != SOAP_DIME_END)
14910  return soap->error;
14911 
14912  return soap->error = SOAP_OK;
14913  }
int soap_move(struct soap *soap, long n)
Definition: stdsoap2.cpp:2051
void(* fdimewriteclose)(struct soap *, void *)
Definition: stdsoap2.h:1673
const char * id
Definition: stdsoap2.h:1444
struct soap_blist * blist
Definition: stdsoap2.h:1624
int error
Definition: stdsoap2.h:1755
struct soap_multipart * first
Definition: stdsoap2.h:1397
size_t size
Definition: stdsoap2.h:1388
static char * soap_getdimefield(struct soap *, size_t)
Definition: stdsoap2.cpp:14644
static struct soap_multipart * soap_new_multipart(struct soap *, struct soap_multipart **, struct soap_multipart **, char *, size_t)
Definition: stdsoap2.cpp:15487
char * ptr
Definition: stdsoap2.h:1392
static void soap_resolve_attachment(struct soap *, struct soap_multipart *)
Definition: stdsoap2.cpp:15254
struct soap_dime dime
Definition: stdsoap2.h:1760
struct soap_blist * soap_new_block(struct soap *soap)
Definition: stdsoap2.cpp:2728
const char * options
Definition: stdsoap2.h:1395
char buf[(65536)]
Definition: stdsoap2.h:1710
size_t size
Definition: stdsoap2.h:1283
char * soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
Definition: stdsoap2.cpp:3179
int soap_recv(struct soap *soap)
Definition: stdsoap2.cpp:1519
int(* fdimewrite)(struct soap *, void *, const char *, size_t)
Definition: stdsoap2.h:1675
void *(* fdimewriteopen)(struct soap *, const char *, const char *, const char *)
Definition: stdsoap2.h:1671
size_t soap_tell(struct soap *soap)
Definition: stdsoap2.cpp:2070
const char * type
Definition: stdsoap2.h:1394
struct soap_multipart * last
Definition: stdsoap2.h:1397
#define SOAP_DIME_END
Definition: stdsoap2.h:1030
size_t bufidx
Definition: stdsoap2.h:1699
#define SOAP_DIME_CF
Definition: stdsoap2.h:1068
int soap_getdimehdr(struct soap *soap)
Definition: stdsoap2.cpp:14690
#define SOAP_OK
Definition: stdsoap2.h:995
void * soap_push_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:2752
#define soap_get1(soap)
Definition: stdsoap2.h:1893
const char * id
Definition: stdsoap2.h:1393
char flags
Definition: stdsoap2.h:1391
#define SOAP_EOM
Definition: stdsoap2.h:1015
const char * options
Definition: stdsoap2.h:1446
#define SOAP_EOF
Definition: stdsoap2.h:993
const char * type
Definition: stdsoap2.h:1445
int32_t soap_wchar
Definition: stdsoap2.h:1257
size_t buflen
Definition: stdsoap2.h:1700
int soap_getdimehdr ( struct soap )

Definition at line 14690 of file stdsoap2.cpp.

References soap_dime::buflen, soap_dime::chunksize, DBGLOG, soap::dime, soap::error, soap_dime::flags, soap_dime::id, soap::mode, soap_dime::options, soap_dime::size, SOAP_DIME_END, SOAP_DIME_ME, SOAP_DIME_MISMATCH, SOAP_DIME_VERSION, SOAP_ENC_DIME, SOAP_EOF, soap_getchar(), soap_getdimefield(), soap_move(), SOAP_OK, SOAP_STR_EOS, soap_tell(), soap_unget, and soap_dime::type.

Referenced by soap_begin_recv(), and soap_getdime().

14691  {
14692  register soap_wchar c;
14693  register char *s;
14694  register int i;
14695  unsigned char tmp[12];
14696  size_t optlen, idlen, typelen;
14697 
14698  if (!(soap->mode & SOAP_ENC_DIME))
14699  return soap->error = SOAP_DIME_END;
14700 
14701  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME header\n"));
14702 
14703  if (soap->dime.buflen || soap->dime.chunksize)
14704  {
14705  if (soap_move(soap, (long)(soap->dime.size - soap_tell(soap))))
14706  return soap->error = SOAP_EOF;
14707 
14708  soap_unget(soap, soap_getchar(soap)); /* skip padding and get hdr */
14709  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... From chunked\n"));
14710  return SOAP_OK;
14711  }
14712 
14713  s = (char*)tmp;
14714 
14715  for (i = 12; i > 0; i--)
14716  {
14717  if ((int)(c = soap_getchar(soap)) == EOF)
14718  return soap->error = SOAP_EOF;
14719 
14720  *s++ = (char)c;
14721  }
14722 
14723  if ((tmp[0] & 0xF8) != SOAP_DIME_VERSION)
14724  return soap->error = SOAP_DIME_MISMATCH;
14725 
14726  soap->dime.flags = (tmp[0] & 0x7) | (tmp[1] & 0xF0);
14727  optlen = (tmp[2] << 8) | tmp[3];
14728  idlen = (tmp[4] << 8) | tmp[5];
14729  typelen = (tmp[6] << 8) | tmp[7];
14730  soap->dime.size = (tmp[8] << 24) | (tmp[9] << 16) | (tmp[10] << 8) | tmp[11];
14731  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME size=%lu flags=0x%X\n", (unsigned long)soap->dime.size, soap->dime.flags));
14732 
14733  if (!(soap->dime.options = soap_getdimefield(soap, optlen)) && soap->error)
14734  return soap->error;
14735 
14736  if (!(soap->dime.id = soap_getdimefield(soap, idlen)) && soap->error)
14737  return soap->error;
14738 
14739  if (!(soap->dime.type = soap_getdimefield(soap, typelen)) && soap->error)
14740  return soap->error;
14741 
14742  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME id=%s, type=%s, options=%s\n", soap->dime.id ? soap->dime.id : SOAP_STR_EOS, soap->dime.type ? soap->dime.type : "", soap->dime.options ? soap->dime.options + 4 : SOAP_STR_EOS));
14743 
14744  if (soap->dime.flags & SOAP_DIME_ME)
14745  soap->mode &= ~SOAP_ENC_DIME;
14746 
14747  return SOAP_OK;
14748  }
int soap_move(struct soap *soap, long n)
Definition: stdsoap2.cpp:2051
size_t chunksize
Definition: stdsoap2.h:1389
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
size_t size
Definition: stdsoap2.h:1388
static char * soap_getdimefield(struct soap *, size_t)
Definition: stdsoap2.cpp:14644
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_dime dime
Definition: stdsoap2.h:1760
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
const char * options
Definition: stdsoap2.h:1395
#define SOAP_DIME_MISMATCH
Definition: stdsoap2.h:1029
#define SOAP_DIME_VERSION
Definition: stdsoap2.h:1071
soap_wchar soap_getchar(struct soap *soap)
Definition: stdsoap2.cpp:1616
size_t soap_tell(struct soap *soap)
Definition: stdsoap2.cpp:2070
const char * type
Definition: stdsoap2.h:1394
#define SOAP_DIME_END
Definition: stdsoap2.h:1030
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
const char * id
Definition: stdsoap2.h:1393
char flags
Definition: stdsoap2.h:1391
#define SOAP_EOF
Definition: stdsoap2.h:993
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
size_t buflen
Definition: stdsoap2.h:1390
int32_t soap_wchar
Definition: stdsoap2.h:1257
#define SOAP_DIME_ME
Definition: stdsoap2.h:1069
int soap_getfault ( struct soap )

Definition at line 106 of file soapC.cpp.

References soap::fault, and soap_get_SOAP_ENV__Fault().

Referenced by soap_recv_fault().

107 {
108  return (soap->fault = soap_get_SOAP_ENV__Fault(soap, NULL, "SOAP-ENV:Fault", NULL)) == NULL;
109 }
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
struct SOAP_ENV__Fault * soap_get_SOAP_ENV__Fault(struct soap *soap, struct SOAP_ENV__Fault *p, const char *tag, const char *type)
Definition: soapC.cpp:2149
int soap_getheader ( struct soap )

Definition at line 48 of file soapC.cpp.

References soap::header, soap::part, SOAP_END_HEADER, SOAP_IN_HEADER, and soap_in_SOAP_ENV__Header().

Referenced by soap_recv_header().

49 {
51  soap->header = soap_in_SOAP_ENV__Header(soap, "SOAP-ENV:Header", NULL, NULL);
53  return soap->header == NULL;
54 }
short part
Definition: stdsoap2.h:1729
#define SOAP_END_HEADER
Definition: stdsoap2.h:1157
struct SOAP_ENV__Header * header
Definition: stdsoap2.h:1631
struct SOAP_ENV__Header * soap_in_SOAP_ENV__Header(struct soap *soap, const char *tag, struct SOAP_ENV__Header *a, const char *type)
Definition: soapC.cpp:2826
#define SOAP_IN_HEADER
Definition: stdsoap2.h:1156
unsigned char* soap_gethex ( struct soap ,
int *   
)

Definition at line 2236 of file stdsoap2.cpp.

References soap_dom_element::data, soap::dom, soap::error, soap::labbuf, soap::labidx, soap::lablen, soap::mode, soap_append_lab(), SOAP_BLKLEN, soap_end_block(), soap_get(), soap_hex2s(), soap_isxdigit(), soap_malloc(), soap_new_block(), soap_push_block(), soap_save_block(), soap_size_block(), soap_string_in(), SOAP_TYPE, soap_unget, and SOAP_XML_DOM.

2237  {
2238 #ifdef WITH_DOM
2239 
2240  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
2241  {
2242  soap->dom->data = soap_string_in(soap, 0, -1, -1);
2243  return (unsigned char*)soap_hex2s(soap, soap->dom->data, NULL, 0, n);
2244  }
2245 
2246 #endif
2247 #ifdef WITH_FAST
2248  soap->labidx = 0;
2249 
2250  for (;;)
2251  {
2252  register char *s;
2253  register size_t i, k;
2254 
2255  if (soap_append_lab(soap, NULL, 0))
2256  return NULL;
2257 
2258  s = soap->labbuf + soap->labidx;
2259  k = soap->lablen - soap->labidx;
2260  soap->labidx = soap->lablen;
2261 
2262  for (i = 0; i < k; i++)
2263  {
2264  register char d1, d2;
2265  register soap_wchar c;
2266  c = soap_get(soap);
2267 
2268  if (soap_isxdigit(c))
2269  {
2270  d1 = (char)c;
2271  c = soap_get(soap);
2272 
2273  if (soap_isxdigit(c))
2274  d2 = (char)c;
2275  else
2276  {
2277  soap->error = SOAP_TYPE;
2278  return NULL;
2279  }
2280  }
2281  else
2282  {
2283  unsigned char *p;
2284  soap_unget(soap, c);
2285 
2286  if (n)
2287  *n = (int)(soap->lablen + i - k);
2288 
2289  p = (unsigned char*)soap_malloc(soap, soap->lablen + i - k);
2290 
2291  if (p)
2292  memcpy(p, soap->labbuf, soap->lablen + i - k);
2293 
2294  return p;
2295  }
2296 
2297  *s++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0');
2298  }
2299  }
2300 
2301 #else
2302 
2303  if (soap_new_block(soap) == NULL)
2304  return NULL;
2305 
2306  for (;;)
2307  {
2308  register int i;
2309  register char *s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN);
2310 
2311  if (!s)
2312  {
2313  soap_end_block(soap, NULL);
2314  return NULL;
2315  }
2316 
2317  for (i = 0; i < SOAP_BLKLEN; i++)
2318  {
2319  register char d1, d2;
2320  register soap_wchar c = soap_get(soap);
2321 
2322  if (soap_isxdigit(c))
2323  {
2324  d1 = (char)c;
2325  c = soap_get(soap);
2326 
2327  if (soap_isxdigit(c))
2328  d2 = (char)c;
2329  else
2330  {
2331  soap_end_block(soap, NULL);
2332  soap->error = SOAP_TYPE;
2333  return NULL;
2334  }
2335  }
2336  else
2337  {
2338  unsigned char *p;
2339  soap_unget(soap, c);
2340 
2341  if (n)
2342  *n = (int)soap_size_block(soap, NULL, i);
2343 
2344  p = (unsigned char*)soap_save_block(soap, NULL, 0);
2345  return p;
2346  }
2347 
2348  *s++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0');
2349  }
2350  }
2351 
2352 #endif
2353  }
size_t lablen
Definition: stdsoap2.h:1708
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
soap_wchar soap_get(struct soap *soap)
Definition: stdsoap2.cpp:1856
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define SOAP_TYPE
Definition: stdsoap2.h:999
static int soap_isxdigit(int)
Definition: stdsoap2.cpp:1281
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
struct soap_blist * soap_new_block(struct soap *soap)
Definition: stdsoap2.cpp:2728
char * soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
Definition: stdsoap2.cpp:3179
#define SOAP_BLKLEN
Definition: stdsoap2.h:841
char * soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
Definition: stdsoap2.cpp:11015
size_t labidx
Definition: stdsoap2.h:1709
char * labbuf
Definition: stdsoap2.h:1707
int soap_append_lab(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:10289
void * soap_push_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:2752
size_t soap_size_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:3038
const char * soap_hex2s(struct soap *soap, const char *s, char *t, size_t l, int *n)
Definition: stdsoap2.cpp:18185
void soap_end_block(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3134
int32_t soap_wchar
Definition: stdsoap2.h:1257
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
int soap_getline ( struct soap ,
char *  ,
int   
)

Definition at line 14288 of file stdsoap2.cpp.

References soap::error, SOAP_EOF, soap_get0, soap_getchar(), SOAP_HDR, and SOAP_OK.

Referenced by http_parse(), and soap_getmimehdr().

14289  {
14290  int i = len;
14291  soap_wchar c = 0;
14292 
14293  for (;;)
14294  {
14295  while (--i > 0)
14296  {
14297  c = soap_getchar(soap);
14298 
14299  if (c == '\r' || c == '\n')
14300  break;
14301 
14302  if ((int)c == EOF)
14303  return soap->error = SOAP_EOF;
14304 
14305  *s++ = (char)c;
14306  }
14307 
14308  if (c != '\n')
14309  c = soap_getchar(soap); /* got \r or something else, now get \n */
14310 
14311  if (c == '\n')
14312  {
14313  *s = '\0';
14314 
14315  if (i + 1 == len) /* empty line: end of HTTP/MIME header */
14316  break;
14317 
14318  c = soap_get0(soap);
14319 
14320  if (c != ' ' && c != '\t') /* HTTP line continuation? */
14321  break;
14322  }
14323  else if ((int)c == EOF)
14324  return soap->error = SOAP_EOF;
14325  }
14326 
14327  if (i < 0)
14328  return soap->error = SOAP_HDR;
14329 
14330  return SOAP_OK;
14331  }
int error
Definition: stdsoap2.h:1755
#define SOAP_HDR
Definition: stdsoap2.h:1017
soap_wchar soap_getchar(struct soap *soap)
Definition: stdsoap2.cpp:1616
#define SOAP_OK
Definition: stdsoap2.h:995
#define soap_get0(soap)
Definition: stdsoap2.h:1892
#define SOAP_EOF
Definition: stdsoap2.h:993
int32_t soap_wchar
Definition: stdsoap2.h:1257
int soap_getmime ( struct soap )

Definition at line 15009 of file stdsoap2.cpp.

References soap::error, and soap_get_mime_attachment().

Referenced by soap_end_recv().

15010  {
15011  while (soap_get_mime_attachment(soap, NULL))
15012  ;
15013 
15014  return soap->error;
15015  }
int error
Definition: stdsoap2.h:1755
struct soap_multipart * soap_get_mime_attachment(struct soap *soap, void *handle)
Definition: stdsoap2.cpp:15054
int soap_getmimehdr ( struct soap )

Definition at line 14923 of file stdsoap2.cpp.

References soap_mime::boundary, DBGLOG, soap_multipart::description, soap_multipart::encoding, soap::error, soap_multipart::id, soap_mime::last, soap_multipart::location, soap::mime, soap::msgbuf, soap_blank, soap_code_int(), SOAP_EOM, soap_get_header_attribute(), soap_getline(), SOAP_MIME_ERROR, SOAP_MIME_NONE, SOAP_OK, soap_set_mime_attachment(), soap_strdup(), soap_tag_cmp(), and soap_multipart::type.

Referenced by soap_begin_recv(), and soap_get_mime_attachment().

14924  {
14925  struct soap_multipart *content;
14926 
14927  do
14928  {
14929  if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf)))
14930  return soap->error;
14931  }
14932  while (!*soap->msgbuf);
14933 
14934  if (soap->msgbuf[0] == '-' && soap->msgbuf[1] == '-')
14935  {
14936  char *s = soap->msgbuf + strlen(soap->msgbuf) - 1;
14937 
14938  /* remove white space */
14939  while (soap_blank(*s))
14940  s--;
14941 
14942  s[1] = '\0';
14943 
14944  if (soap->mime.boundary)
14945  {
14946  if (strcmp(soap->msgbuf + 2, soap->mime.boundary))
14947  return soap->error = SOAP_MIME_ERROR;
14948  }
14949  else
14951 
14952  if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf)))
14953  return soap->error;
14954  }
14955 
14956  if (soap_set_mime_attachment(soap, NULL, 0, SOAP_MIME_NONE, NULL, NULL, NULL, NULL))
14957  return soap->error = SOAP_EOM;
14958 
14959  content = soap->mime.last;
14960 
14961  for (;;)
14962  {
14963  register char *key = soap->msgbuf;
14964  register char *val;
14965 
14966  if (!*key)
14967  break;
14968 
14969  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "MIME header: %s\n", key));
14970  val = strchr(soap->msgbuf, ':');
14971 
14972  if (val)
14973  {
14974  *val = '\0';
14975 
14976  do val++;
14977 
14978  while (*val && *val <= 32);
14979 
14980  if (!soap_tag_cmp(key, "Content-ID"))
14981  content->id = soap_strdup(soap, val);
14982  else if (!soap_tag_cmp(key, "Content-Location"))
14983  content->location = soap_strdup(soap, val);
14984  else if (!soap_tag_cmp(key, "Content-Disposition"))
14985  content->id = soap_strdup(soap, soap_get_header_attribute(soap, val, "name"));
14986  else if (!soap_tag_cmp(key, "Content-Type"))
14987  content->type = soap_strdup(soap, val);
14988  else if (!soap_tag_cmp(key, "Content-Description"))
14989  content->description = soap_strdup(soap, val);
14990  else if (!soap_tag_cmp(key, "Content-Transfer-Encoding"))
14991  content->encoding = (enum soap_mime_encoding)soap_code_int(mime_codes, val, (long)SOAP_MIME_NONE);
14992  }
14993 
14994  if (soap_getline(soap, key, sizeof(soap->msgbuf)))
14995  return soap->error;
14996  }
14997 
14998  return SOAP_OK;
14999  }
char msgbuf[1024]
Definition: stdsoap2.h:1711
const char * id
Definition: stdsoap2.h:1444
long soap_code_int(const struct soap_code_map *code_map, const char *str, long other)
Definition: stdsoap2.cpp:1660
int error
Definition: stdsoap2.h:1755
const char * location
Definition: stdsoap2.h:1448
int soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:3657
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
soap_mime_encoding
Definition: stdsoap2.h:1425
#define SOAP_MIME_ERROR
Definition: stdsoap2.h:1031
enum soap_mime_encoding encoding
Definition: stdsoap2.h:1447
#define soap_blank(c)
Definition: stdsoap2.cpp:118
int soap_getline(struct soap *soap, char *s, int len)
Definition: stdsoap2.cpp:14288
struct soap_multipart * last
Definition: stdsoap2.h:1413
char * boundary
Definition: stdsoap2.h:1410
#define SOAP_OK
Definition: stdsoap2.h:995
const char * soap_get_header_attribute(struct soap *soap, const char *line, const char *key)
Definition: stdsoap2.cpp:17301
const char * description
Definition: stdsoap2.h:1449
int soap_set_mime_attachment(struct soap *soap, char *ptr, size_t size, enum soap_mime_encoding encoding, const char *type, const char *id, const char *location, const char *description)
Definition: stdsoap2.cpp:15545
#define SOAP_EOM
Definition: stdsoap2.h:1015
struct soap_mime mime
Definition: stdsoap2.h:1761
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
const char * type
Definition: stdsoap2.h:1445
static const struct soap_code_map mime_codes[]
Definition: stdsoap2.cpp:502
int soap_getoffsets ( const char *  ,
const int *  ,
int *  ,
int   
)

Definition at line 3334 of file stdsoap2.cpp.

3335  {
3336  register int i, j = 0;
3337 
3338  if (offset)
3339  for (i = 0; i < dim && attr && *attr; i++)
3340  {
3341  attr++;
3342  j *= size[i];
3343  j += offset[i] = (int)atol(attr);
3344  attr = strchr(attr, ',');
3345  }
3346  else
3347  for (i = 0; i < dim && attr && *attr; i++)
3348  {
3349  attr++;
3350  j *= size[i];
3351  j += (int)atol(attr);
3352  attr = strchr(attr, ',');
3353  }
3354 
3355  return j;
3356  }
int soap_getposition ( const char *  ,
int *   
)

Definition at line 3452 of file stdsoap2.cpp.

References SOAP_MAXDIMS.

Referenced by soap_peek_element().

3453  {
3454  register int i, n;
3455 
3456  if (!*attr)
3457  return - 1;
3458 
3459  n = 0;
3460  i = 1;
3461 
3462  do
3463  {
3464  pos[n++] = (int)atol(attr + i);
3465 
3466  while (attr[i] && attr[i] != ',' && attr[i] != ']')
3467  i++;
3468 
3469  if (attr[i] == ',')
3470  i++;
3471  }
3472  while (n < SOAP_MAXDIMS && attr[i] && attr[i] != ']');
3473 
3474  return n;
3475  }
#define SOAP_MAXDIMS
Definition: stdsoap2.h:862
int soap_getsize ( const char *  ,
const char *  ,
int *   
)

Definition at line 3364 of file stdsoap2.cpp.

References SOAP_MAXARRAYSIZE, and soap_strtol.

Referenced by soap_in_ArrayOf_USCORExsd_USCOREstring().

3365  {
3366  register int n, k;
3367  char *s;
3368  *j = 0;
3369 
3370  if (!*attr1)
3371  return - 1;
3372 
3373  if (*attr1 == '[')
3374  attr1++;
3375 
3376  n = 1;
3377 
3378  for (;;)
3379  {
3380  k = (int)soap_strtol(attr1, &s, 10);
3381  n *= k;
3382 
3383  if (k < 0 || n > SOAP_MAXARRAYSIZE || s == attr1)
3384  return - 1;
3385 
3386  attr1 = strchr(s, ',');
3387 
3388  if (!attr1)
3389  attr1 = strchr(s, ' ');
3390 
3391  if (attr2 && *attr2)
3392  {
3393  attr2++;
3394  *j *= k;
3395  k = (int)soap_strtol(attr2, &s, 10);
3396  *j += k;
3397 
3398  if (k < 0)
3399  return - 1;
3400 
3401  attr2 = s;
3402  }
3403 
3404  if (!attr1)
3405  break;
3406 
3407  attr1++;
3408  }
3409 
3410  return n - *j;
3411  }
#define soap_strtol(s, t, b)
Definition: stdsoap2.h:1919
#define SOAP_MAXARRAYSIZE
Definition: stdsoap2.h:884
int soap_getsizes ( const char *  ,
int *  ,
int   
)

Definition at line 3419 of file stdsoap2.cpp.

References SOAP_MAXARRAYSIZE.

3420  {
3421  register int i, k, n;
3422 
3423  if (!*attr)
3424  return - 1;
3425 
3426  i = (int)strlen(attr);
3427  n = 1;
3428 
3429  do
3430  {
3431  for (i = i - 1; i >= 0; i--)
3432  if (attr[i] == '[' || attr[i] == ',' || attr[i] == ' ')
3433  break;
3434 
3435  k = (int)atol(attr + i + 1);
3436  n *= size[--dim] = k;
3437 
3438  if (k < 0 || n > SOAP_MAXARRAYSIZE)
3439  return - 1;
3440  }
3441  while (i >= 0 && attr[i] != '[');
3442 
3443  return n;
3444  }
#define SOAP_MAXARRAYSIZE
Definition: stdsoap2.h:884
soap_wchar soap_getutf8 ( struct soap )

Definition at line 2143 of file stdsoap2.cpp.

References soap::ahead, soap::mode, SOAP_ENC_LATIN, soap_get(), soap_get1, and soap_revget1.

Referenced by soap_peek_element(), soap_string_in(), and soap_wstring_in().

2144  {
2145  register soap_wchar c, c1, c2, c3, c4;
2146  c = soap->ahead;
2147 
2148  if (c > 0xFF)
2149  {
2150  soap->ahead = 0;
2151  return c;
2152  }
2153 
2154 again:
2155  c = soap_get(soap);
2156 
2157  if (c < 0x80 || (soap->mode & SOAP_ENC_LATIN))
2158  return c;
2159 
2160  c1 = soap_get1(soap);
2161 
2162  if (c1 < 0x80)
2163  {
2164  soap_revget1(soap); /* doesn't look like this is UTF8 */
2165  return c;
2166  }
2167 
2168  c1 &= 0x3F;
2169 
2170  if (c < 0xE0)
2171  return ((soap_wchar)(c & 0x1F) << 6) | c1;
2172 
2173  c2 = (soap_wchar)soap_get1(soap) & 0x3F;
2174 
2175  if (c == 0xEF && c1 == 0x3B && c2 == 0x3F) /* ignore UTF-8 BOM */
2176  goto again;
2177 
2178  if (c < 0xF0)
2179  return ((soap_wchar)(c & 0x0F) << 12) | (c1 << 6) | c2;
2180 
2181  c3 = (soap_wchar)soap_get1(soap) & 0x3F;
2182 
2183  if (c < 0xF8)
2184  return ((soap_wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
2185 
2186  c4 = (soap_wchar)soap_get1(soap) & 0x3F;
2187 
2188  if (c < 0xFC)
2189  return ((soap_wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4;
2190 
2191  return ((soap_wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (soap_wchar)(soap_get1(soap) & 0x3F);
2192  }
soap_wchar soap_get(struct soap *soap)
Definition: stdsoap2.cpp:1856
soap_mode mode
Definition: stdsoap2.h:1601
soap_wchar ahead
Definition: stdsoap2.h:1701
#define soap_revget1(soap)
Definition: stdsoap2.h:1899
#define SOAP_ENC_LATIN
Definition: stdsoap2.h:1097
#define soap_get1(soap)
Definition: stdsoap2.h:1893
int32_t soap_wchar
Definition: stdsoap2.h:1257
size_t soap_hash ( const char *  )
void soap_header ( struct soap )

Definition at line 56 of file soapC.cpp.

References soap::header, soap_default_SOAP_ENV__Header(), and soap_new_SOAP_ENV__Header().

57 {
58  if (!soap->header)
59  {
62  }
63 }
struct SOAP_ENV__Header * header
Definition: stdsoap2.h:1631
struct SOAP_ENV__Header * soap_new_SOAP_ENV__Header(struct soap *soap, int n)
Definition: soapC.cpp:2868
void soap_default_SOAP_ENV__Header(struct soap *soap, struct SOAP_ENV__Header *a)
Definition: soapC.cpp:2789
const char* soap_hex2s ( struct soap ,
const char *  ,
char *  ,
size_t  ,
int *   
)

Definition at line 18185 of file stdsoap2.cpp.

References soap::error, soap_malloc(), and SOAP_NON_NULL.

Referenced by soap_gethex().

18186  {
18187  register const char *p;
18188 
18189  if (!s || !*s)
18190  {
18191  if (n)
18192  *n = 0;
18193 
18194  if (soap->error)
18195  return NULL;
18196 
18197  return SOAP_NON_NULL;
18198  }
18199 
18200  if (!t)
18201  {
18202  l = strlen(s) / 2;
18203  t = (char*)soap_malloc(soap, l);
18204  }
18205 
18206  if (!t)
18207  return NULL;
18208 
18209  p = t;
18210 
18211  while (l)
18212  {
18213  register int d1, d2;
18214  d1 = *s++;
18215 
18216  if (!d1)
18217  break;
18218 
18219  d2 = *s++;
18220 
18221  if (!d2)
18222  break;
18223 
18224  *t++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0');
18225  l--;
18226  }
18227 
18228  if (n)
18229  *n = (int)(t - p);
18230 
18231  return p;
18232  }
int error
Definition: stdsoap2.h:1755
#define SOAP_NON_NULL
Definition: stdsoap2.cpp:311
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
void* soap_id_enter ( struct soap ,
const char *  id,
void p,
int  t,
size_t  n,
unsigned int  k,
const char *  type,
const char *  arrayType,
void *(*)(struct soap *, int, const char *, const char *, size_t *)  finstantiate 
)

Definition at line 7661 of file stdsoap2.cpp.

References soap::alloced, soap_ilist::copy, DBGLOG, soap::error, soap_ilist::flist, soap::id, soap_ilist::level, soap_ilist::link, soap_ilist::ptr, soap_ilist::size, SOAP_DUPLICATE_ID, soap_enter(), SOAP_HREF, soap_lookup(), soap_malloc(), and soap_ilist::type.

Referenced by soap_class_id_enter(), soap_in_ns2__getDataResourcesResponse(), soap_in_ns2__getDataTypesId(), soap_in_ns2__getDataTypesIdResponse(), soap_in_ns2__getDataTypesName(), soap_in_ns2__getDataTypesNameResponse(), soap_in_ns2__getDataTypeSynonymsResponse(), soap_in_ns2__getDataTypeURIsResponse(), soap_in_ns2__getJavaLibraryVersion(), soap_in_ns2__getLocationsResponse(), soap_in_ns2__getLocationsResponse_(), soap_in_ns2__getNamesResponse(), soap_in_ns2__getServicesInfo(), soap_in_ns2__getServicesVersion(), soap_in_SOAP_ENV__Code(), soap_in_SOAP_ENV__Detail(), soap_in_SOAP_ENV__Fault(), soap_in_SOAP_ENV__Header(), soap_in_SOAP_ENV__Reason(), soap_inbyte(), soap_indateTime(), soap_indouble(), soap_infloat(), soap_inint(), soap_inlong(), soap_inLONG64(), soap_inshort(), soap_instring(), soap_inULONG64(), soap_inunsignedByte(), soap_inunsignedInt(), soap_inunsignedLong(), soap_inunsignedShort(), and soap_inwstring().

7662  {
7663 #ifndef WITH_NOIDREF
7664  struct soap_ilist *ip;
7665 #endif
7666  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enter id='%s' type=%d loc=%p size=%lu level=%u\n", id, t, p, (unsigned long)n, k));
7667  soap->alloced = 0;
7668 
7669  if (!p)
7670  {
7671  if (finstantiate)
7672  p = finstantiate(soap, t, type, arrayType, &n);
7673  else
7674  p = soap_malloc(soap, n);
7675 
7676  if (p)
7677  soap->alloced = 1;
7678  }
7679 
7680 #ifndef WITH_NOIDREF
7681 
7682  if (!id || !*id)
7683 #endif
7684  return p;
7685 
7686 #ifndef WITH_NOIDREF
7687  ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */
7688  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup entry id='%s for location=%p'\n", id, p));
7689 
7690  if (!ip)
7691  {
7692  if (!(ip = soap_enter(soap, id))) /* new hash table entry for string id */
7693  return NULL;
7694 
7695  ip->type = t;
7696  ip->link = NULL;
7697  ip->copy = NULL;
7698  ip->flist = NULL;
7699  ip->size = n;
7700  ip->ptr = p;
7701  ip->level = k;
7702  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New entry id='%s' type=%d size=%lu level=%u location=%p\n", id, t, (unsigned long)n, k, p));
7703  }
7704  else if ((ip->type != t || (ip->level == k && ip->size != n)) && (ip->copy || ip->flist))
7705  {
7706  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", id, ip->type, (unsigned long)ip->size, k, t, (unsigned long)n));
7707  strcpy(soap->id, id);
7708  soap->error = SOAP_HREF;
7709  return NULL;
7710  }
7711  else if (ip->ptr)
7712  {
7713  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Multiply defined id='%s'\n", id));
7714  strcpy(soap->id, id);
7716  return NULL;
7717  }
7718  else
7719  {
7720  ip->size = n;
7721  ip->ptr = p;
7722  ip->level = k;
7723  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Update entry id='%s' type=%d location=%p size=%lu level=%u\n", id, t, p, (unsigned long)n, k));
7724  }
7725 
7726  return ip->ptr;
7727 #endif
7728  }
short alloced
Definition: stdsoap2.h:1730
int error
Definition: stdsoap2.h:1755
#define SOAP_HREF
Definition: stdsoap2.h:1021
struct soap_ilist * soap_lookup(struct soap *soap, const char *id)
Definition: stdsoap2.cpp:7037
void * link
Definition: stdsoap2.h:1870
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
unsigned int level
Definition: stdsoap2.h:1874
void * ptr
Definition: stdsoap2.h:1873
char id[(1024)]
Definition: stdsoap2.h:1714
void * copy
Definition: stdsoap2.h:1871
struct soap_ilist * soap_enter(struct soap *soap, const char *id)
Definition: stdsoap2.cpp:7056
#define SOAP_DUPLICATE_ID
Definition: stdsoap2.h:1019
struct soap_flist * flist
Definition: stdsoap2.h:1872
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
size_t size
Definition: stdsoap2.h:1869
void* soap_id_forward ( struct soap ,
const char *  id,
void p,
size_t  len,
int  st,
int  tt,
size_t  n,
unsigned int  k,
void(*)(struct soap *, int, int, void *, size_t, const void *, size_t)  fcopy 
)

Definition at line 7589 of file stdsoap2.cpp.

References soap_ilist::copy, DBGLOG, soap::error, soap_flist::fcopy, soap_ilist::flist, soap::id, soap_flist::len, soap_flist::level, soap_ilist::level, soap_ilist::link, soap_flist::next, soap_flist::ptr, soap_ilist::ptr, soap_ilist::size, soap_enter(), SOAP_EOM, soap_fcopy(), SOAP_HREF, soap_lookup(), SOAP_MALLOC, soap_flist::type, and soap_ilist::type.

Referenced by soap_in_ArrayOf_USCORExsd_USCOREstring(), soap_in_ns2__checkRegExp(), soap_in_ns2__checkRegExpResponse(), soap_in_ns2__getDataResources(), soap_in_ns2__getDataResourcesResponse(), soap_in_ns2__getDataTypeDef(), soap_in_ns2__getDataTypeDefResponse(), soap_in_ns2__getDataTypePattern(), soap_in_ns2__getDataTypePatternResponse(), soap_in_ns2__getDataTypesId(), soap_in_ns2__getDataTypesIdResponse(), soap_in_ns2__getDataTypesName(), soap_in_ns2__getDataTypesNameResponse(), soap_in_ns2__getDataTypeSynonyms(), soap_in_ns2__getDataTypeSynonymsResponse(), soap_in_ns2__getDataTypeURI(), soap_in_ns2__getDataTypeURIResponse(), soap_in_ns2__getDataTypeURIs(), soap_in_ns2__getDataTypeURIsResponse(), soap_in_ns2__getJavaLibraryVersion(), soap_in_ns2__getJavaLibraryVersionResponse(), soap_in_ns2__getLocation(), soap_in_ns2__getLocationResponse(), soap_in_ns2__getLocations(), soap_in_ns2__getLocations_(), soap_in_ns2__getLocationsResponse(), soap_in_ns2__getLocationsResponse_(), soap_in_ns2__getMiriamURI(), soap_in_ns2__getMiriamURIResponse(), soap_in_ns2__getName(), soap_in_ns2__getNameResponse(), soap_in_ns2__getNames(), soap_in_ns2__getNamesResponse(), soap_in_ns2__getOfficialDataTypeURI(), soap_in_ns2__getOfficialDataTypeURIResponse(), soap_in_ns2__getResourceInfo(), soap_in_ns2__getResourceInfoResponse(), soap_in_ns2__getResourceInstitution(), soap_in_ns2__getResourceInstitutionResponse(), soap_in_ns2__getResourceLocation(), soap_in_ns2__getResourceLocationResponse(), soap_in_ns2__getServicesInfo(), soap_in_ns2__getServicesInfoResponse(), soap_in_ns2__getServicesVersion(), soap_in_ns2__getServicesVersionResponse(), soap_in_ns2__getURI(), soap_in_ns2__getURIResponse(), soap_in_ns2__isDeprecated(), soap_in_ns2__isDeprecatedResponse(), soap_in_SOAP_ENV__Code(), soap_in_SOAP_ENV__Detail(), soap_in_SOAP_ENV__Fault(), soap_in_SOAP_ENV__Header(), soap_in_SOAP_ENV__Reason(), soap_in_std__string(), soap_inbyte(), soap_indateTime(), soap_indouble(), soap_infloat(), soap_inint(), soap_inlong(), soap_inLONG64(), soap_inshort(), soap_inULONG64(), soap_inunsignedByte(), soap_inunsignedInt(), soap_inunsignedLong(), and soap_inunsignedShort().

7590  {
7591  struct soap_ilist *ip;
7592 
7593  if (!p || !href || !*href)
7594  return p;
7595 
7596  ip = soap_lookup(soap, href); /* lookup pointer to hash table entry for string id */
7597 
7598  if (!ip)
7599  {
7600  if (!(ip = soap_enter(soap, href))) /* new hash table entry for string id */
7601  return NULL;
7602 
7603  ip->type = st;
7604  ip->size = n;
7605  ip->link = NULL;
7606  ip->copy = NULL;
7607  ip->ptr = NULL;
7608  ip->level = 0;
7609  ip->flist = NULL;
7610  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New entry href='%s' type=%d size=%lu level=%d location=%p\n", href, st, (unsigned long)n, k, p));
7611  }
7612  else if (ip->type != st || (ip->level == k && ip->size != n))
7613  {
7614  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Type incompatibility id='%s' expect type=%d size=%lu level=%u got type=%d size=%lu\n", href, ip->type, (unsigned long)ip->size, k, st, (unsigned long)n));
7615  strcpy(soap->id, href);
7616  soap->error = SOAP_HREF;
7617  return NULL;
7618  }
7619 
7620  if (fcopy || n < sizeof(void*) || *href != '#')
7621  {
7622  register struct soap_flist *fp = (struct soap_flist*)SOAP_MALLOC(soap, sizeof(struct soap_flist));
7623 
7624  if (!fp)
7625  {
7626  soap->error = SOAP_EOM;
7627  return NULL;
7628  }
7629 
7630  fp->next = ip->flist;
7631  fp->type = tt;
7632  fp->ptr = p;
7633  fp->level = k;
7634  fp->len = len;
7635 
7636  if (fcopy)
7637  fp->fcopy = fcopy;
7638  else
7639  fp->fcopy = soap_fcopy;
7640 
7641  ip->flist = fp;
7642  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding type=%d (target type=%d) size=%lu location=%p level=%u len=%lu href='%s'\n", st, tt, (unsigned long)n, p, k, (unsigned long)len, href));
7643  }
7644  else
7645  {
7646  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding copying address %p for type=%d href='%s'\n", p, st, href));
7647  *(void**)p = ip->copy;
7648  ip->copy = p;
7649  }
7650 
7651  return p;
7652  }
void soap_fcopy(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
Definition: stdsoap2.cpp:7736
int error
Definition: stdsoap2.h:1755
#define SOAP_HREF
Definition: stdsoap2.h:1021
struct soap_ilist * soap_lookup(struct soap *soap, const char *id)
Definition: stdsoap2.cpp:7037
struct soap_flist * next
Definition: stdsoap2.h:1856
void * link
Definition: stdsoap2.h:1870
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
unsigned int level
Definition: stdsoap2.h:1874
void * ptr
Definition: stdsoap2.h:1873
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
size_t len
Definition: stdsoap2.h:1860
unsigned int level
Definition: stdsoap2.h:1859
void(* fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t)
Definition: stdsoap2.h:1861
char id[(1024)]
Definition: stdsoap2.h:1714
void * ptr
Definition: stdsoap2.h:1858
void * copy
Definition: stdsoap2.h:1871
struct soap_ilist * soap_enter(struct soap *soap, const char *id)
Definition: stdsoap2.cpp:7056
struct soap_flist * flist
Definition: stdsoap2.h:1872
#define SOAP_EOM
Definition: stdsoap2.h:1015
size_t size
Definition: stdsoap2.h:1869
void* soap_id_lookup ( struct soap ,
const char *  id,
void **  p,
int  t,
size_t  n,
unsigned int  k 
)

Definition at line 7471 of file stdsoap2.cpp.

References soap_ilist::copy, DBGLOG, soap::error, soap_ilist::flist, soap::id, soap_ilist::level, soap_ilist::link, soap_ilist::ptr, soap_ilist::size, soap_enter(), SOAP_HREF, soap_lookup(), soap_malloc(), and soap_ilist::type.

Referenced by soap_in_PointerToArrayOf_USCORExsd_USCOREstring(), soap_in_PointerToSOAP_ENV__Code(), soap_in_PointerToSOAP_ENV__Detail(), soap_in_PointerToSOAP_ENV__Reason(), soap_in_PointerTostd__string(), soap_instring(), and soap_inwstring().

7472  {
7473  struct soap_ilist *ip;
7474  void **q;
7475 
7476  if (!p || !id || !*id)
7477  return p;
7478 
7479  ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */
7480 
7481  if (!ip)
7482  {
7483  if (!(ip = soap_enter(soap, id))) /* new hash table entry for string id */
7484  return NULL;
7485 
7486  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding first href='%s' type=%d %p (%u bytes)\n", id, t, p, (unsigned int)n));
7487  ip->type = t;
7488  ip->size = n;
7489  ip->link = p;
7490  ip->copy = NULL;
7491  ip->flist = NULL;
7492  ip->ptr = NULL;
7493  ip->level = k;
7494  *p = NULL;
7495  }
7496  else if (ip->ptr)
7497  {
7498  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolved href='%s' type=%d location=%p (%u bytes)\n", id, t, ip->ptr, (unsigned int)n));
7499 
7500  if (ip->type != t)
7501  {
7502  strcpy(soap->id, id);
7503  soap->error = SOAP_HREF;
7504  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Type incompatibility: href='%s' id-type=%d href-type=%d\n", id, ip->type, t));
7505  return NULL;
7506  }
7507 
7508  while (ip->level < k)
7509  {
7510  q = (void**)soap_malloc(soap, sizeof(void*));
7511 
7512  if (!q)
7513  return NULL;
7514 
7515  *p = (void*)q;
7516  p = q;
7517  k--;
7518  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
7519  }
7520 
7521  *p = ip->ptr;
7522  }
7523  else if (ip->level > k)
7524  {
7525  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving level %u pointers to href='%s'\n", ip->level, id));
7526 
7527  while (ip->level > k)
7528  {
7529  void *s, **r = &ip->link;
7530  q = (void**)ip->link;
7531 
7532  while (q)
7533  {
7534  *r = (void*)soap_malloc(soap, sizeof(void*));
7535 
7536  if (!*r)
7537  return NULL;
7538 
7539  s = *q;
7540  *q = *r;
7541  r = (void**) * r;
7542  q = (void**)s;
7543  }
7544 
7545  *r = NULL;
7546  ip->size = n;
7547  ip->copy = NULL;
7548  ip->level = ip->level - 1;
7549  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
7550  }
7551 
7552  q = (void**)ip->link;
7553  ip->link = p;
7554  *p = (void*)q;
7555  }
7556  else
7557  {
7558  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarded href='%s' type=%d location=%p (%u bytes)\n", id, t, p, (unsigned int)n));
7559 
7560  while (ip->level < k)
7561  {
7562  q = (void**)soap_malloc(soap, sizeof(void*));
7563 
7564  if (!q)
7565  return NULL;
7566 
7567  *p = q;
7568  p = q;
7569  k--;
7570  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
7571  }
7572 
7573  q = (void**)ip->link;
7574  ip->link = p;
7575  *p = (void*)q;
7576  }
7577 
7578  return p;
7579  }
int error
Definition: stdsoap2.h:1755
#define SOAP_HREF
Definition: stdsoap2.h:1021
struct soap_ilist * soap_lookup(struct soap *soap, const char *id)
Definition: stdsoap2.cpp:7037
void * link
Definition: stdsoap2.h:1870
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
unsigned int level
Definition: stdsoap2.h:1874
void * ptr
Definition: stdsoap2.h:1873
char id[(1024)]
Definition: stdsoap2.h:1714
void * copy
Definition: stdsoap2.h:1871
struct soap_ilist * soap_enter(struct soap *soap, const char *id)
Definition: stdsoap2.cpp:7056
struct soap_flist * flist
Definition: stdsoap2.h:1872
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
size_t size
Definition: stdsoap2.h:1869
char* soap_inbyte ( struct soap ,
const char *  tag,
char *  p,
const char *  ,
int   
)

Definition at line 12306 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2byte(), SOAP_TYPE, soap_value(), and soap::type.

Referenced by soap_in_byte().

12307  {
12308  if (soap_element_begin_in(soap, tag, 0, NULL))
12309  return NULL;
12310 
12311 #ifndef WITH_LEAN
12312 
12313  if (*soap->type
12315  && soap_match_tag(soap, soap->type, ":byte"))
12316  {
12317  soap->error = SOAP_TYPE;
12318  soap_revert(soap);
12319  return NULL;
12320  }
12321 
12322 #endif
12323  p = (char*)soap_id_enter(soap, soap->id, p, t, sizeof(char), 0, NULL, NULL, NULL);
12324 
12325  if (*soap->href)
12326  p = (char*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(char), 0, NULL);
12327  else if (p)
12328  {
12329  if (soap_s2byte(soap, soap_value(soap), p))
12330  return NULL;
12331  }
12332 
12333  if (soap->body && soap_element_end_in(soap, tag))
12334  return NULL;
12335 
12336  return p;
12337  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
int soap_s2byte(struct soap *soap, const char *s, char *p)
Definition: stdsoap2.cpp:12283
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
time_t* soap_indateTime ( struct soap ,
const char *  tag,
time_t *  p,
const char *  ,
int   
)

Definition at line 13992 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2dateTime(), SOAP_TYPE, soap_value(), and soap::type.

13993  {
13994  if (soap_element_begin_in(soap, tag, 0, NULL))
13995  return NULL;
13996 
13997  if (*soap->type
13999  && soap_match_tag(soap, soap->type, ":dateTime"))
14000  {
14001  soap->error = SOAP_TYPE;
14002  soap_revert(soap);
14003  return NULL;
14004  }
14005 
14006  p = (time_t*)soap_id_enter(soap, soap->id, p, t, sizeof(time_t), 0, NULL, NULL, NULL);
14007 
14008  if (*soap->href)
14009  p = (time_t*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(time_t), 0, NULL);
14010  else if (p)
14011  {
14012  if (soap_s2dateTime(soap, soap_value(soap), p))
14013  return NULL;
14014  }
14015 
14016  if (soap->body && soap_element_end_in(soap, tag))
14017  return NULL;
14018 
14019  return p;
14020  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_s2dateTime(struct soap *soap, const char *s, time_t *p)
Definition: stdsoap2.cpp:13900
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
double* soap_indouble ( struct soap ,
const char *  tag,
double *  p,
const char *  ,
int   
)

Definition at line 12719 of file stdsoap2.cpp.

References soap::body, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_isnumeric(), soap_s2double(), soap_value(), and soap::type.

12720  {
12721  if (soap_element_begin_in(soap, tag, 0, NULL))
12722  return NULL;
12723 
12724 #ifndef WITH_LEAN
12725 
12726  if (*soap->type != '\0' && soap_isnumeric(soap, type))
12727  return NULL;
12728 
12729 #endif
12730  p = (double*)soap_id_enter(soap, soap->id, p, t, sizeof(double), 0, NULL, NULL, NULL);
12731 
12732  if (*soap->href)
12733  p = (double*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(double), 0, NULL);
12734  else if (p)
12735  {
12736  if (soap_s2double(soap, soap_value(soap), p))
12737  return NULL;
12738  }
12739 
12740  if (soap->body && soap_element_end_in(soap, tag))
12741  return NULL;
12742 
12743  return p;
12744  }
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int soap_s2double(struct soap *soap, const char *s, double *p)
Definition: stdsoap2.cpp:12663
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
static int soap_isnumeric(struct soap *, const char *)
Definition: stdsoap2.cpp:12548
char href[(1024)]
Definition: stdsoap2.h:1715
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
float* soap_infloat ( struct soap ,
const char *  tag,
float *  p,
const char *  ,
int   
)

Definition at line 12582 of file stdsoap2.cpp.

References soap::body, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_isnumeric(), soap_s2float(), soap_value(), and soap::type.

12583  {
12584  if (soap_element_begin_in(soap, tag, 0, NULL))
12585  return NULL;
12586 
12587 #ifndef WITH_LEAN
12588 
12589  if (*soap->type != '\0' && soap_isnumeric(soap, type))
12590  return NULL;
12591 
12592 #endif
12593  p = (float*)soap_id_enter(soap, soap->id, p, t, sizeof(float), 0, NULL, NULL, NULL);
12594 
12595  if (*soap->href)
12596  p = (float*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(float), 0, NULL);
12597  else if (p)
12598  {
12599  if (soap_s2float(soap, soap_value(soap), p))
12600  return NULL;
12601  }
12602 
12603  if (soap->body && soap_element_end_in(soap, tag))
12604  return NULL;
12605 
12606  return p;
12607  }
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
static int soap_isnumeric(struct soap *, const char *)
Definition: stdsoap2.cpp:12548
char href[(1024)]
Definition: stdsoap2.h:1715
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
int soap_s2float(struct soap *soap, const char *s, float *p)
Definition: stdsoap2.cpp:12482
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
int* soap_inint ( struct soap ,
const char *  tag,
int *  p,
const char *  ,
int   
)

Definition at line 12006 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2int(), SOAP_TYPE, soap_value(), and soap::type.

Referenced by soap_in_int().

12007  {
12008  if (soap_element_begin_in(soap, tag, 0, NULL))
12009  return NULL;
12010 
12011 #ifndef WITH_LEAN
12012 
12013  if (*soap->type
12015  && soap_match_tag(soap, soap->type, ":int")
12016  && soap_match_tag(soap, soap->type, ":short")
12017  && soap_match_tag(soap, soap->type, ":byte"))
12018  {
12019  soap->error = SOAP_TYPE;
12020  soap_revert(soap);
12021  return NULL;
12022  }
12023 
12024 #endif
12025  p = (int*)soap_id_enter(soap, soap->id, p, t, sizeof(int), 0, NULL, NULL, NULL);
12026 
12027  if (*soap->href)
12028  p = (int*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(int), 0, NULL);
12029  else if (p)
12030  {
12031  if (soap_s2int(soap, soap_value(soap), p))
12032  return NULL;
12033  }
12034 
12035  if (soap->body && soap_element_end_in(soap, tag))
12036  return NULL;
12037 
12038  return p;
12039  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
int soap_s2int(struct soap *soap, const char *s, int *p)
Definition: stdsoap2.cpp:11975
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
void soap_init ( struct soap )

Definition at line 8441 of file stdsoap2.cpp.

References soap::accept_flags, soap::accept_timeout, soap::action, soap::actor, soap::alist, soap::attributes, soap::authrealm, soap::bind_flags, soap::bio, soap::blist, soap_mime::boundary, soap::c14nexclude, soap::c14ninclude, soap::c_locale, soap::cafile, soap::capath, soap::clist, soap::connect_flags, soap::connect_timeout, soap::cookie_domain, soap::cookie_max, soap::cookie_path, soap::cookies, soap::crlfile, soap::ctx, soap::d_stream, DBGLOG, soap::dhfile, soap::dime, soap::dime_id_format, soap::dom, soap::double_format, soap::encodingStyle, soap::faccept, soap::fault, soap::fclose, soap::fclosesocket, soap::fconnect, soap::fdel, soap::fdimeread, soap::fdimereadclose, soap::fdimereadopen, soap::fdimewrite, soap::fdimewriteclose, soap::fdimewriteopen, soap::fdisconnect, soap::fform, soap::fget, soap::fhead, soap::fheader, soap::fignore, soap_dime::first, soap_mime::first, soap::float_format, soap::fmalloc, soap::fmimeread, soap::fmimereadclose, soap::fmimereadopen, soap::fmimewrite, soap::fmimewriteclose, soap::fmimewriteopen, soap::fopen, soap::fparse, soap::fparsehdr, fplugin(), soap::fplugin, soap::fpoll, soap::fpost, soap::fposthdr, soap::fpreparefinal, soap::fprepareinit, soap::fpreparerecv, soap::fpreparesend, soap::fput, frecv(), soap::frecv, soap::fresolve, soap::fresponse, fsend(), soap::fsend, soap::fserveloop, soap::fseterror, soap::fshutdownsocket, soap::fsslauth, soap::fsslverify, soap::header, soap::host, soap::http_content, http_del(), http_get(), http_head(), http_parse(), http_parse_header(), http_post(), http_post_header(), http_put(), http_response(), soap::http_version, soap::ip, soap::ipv4_multicast_if, soap::ipv6_multicast_if, soap::is, soap::keep_alive, soap::keyfile, soap::labbuf, soap::labidx, soap::lablen, soap::lang, soap_dime::last, soap_mime::last, soap::linger_time, soap_dime::list, soap_mime::list, soap::local_namespaces, soap::master, soap::max_keep_alive, soap::mime, namespaces, soap::namespaces, soap::nlist, soap::os, soap::passwd, soap::password, soap::plugins, soap::port, soap::prolog, soap::proxy_host, soap::proxy_http_version, soap::proxy_passwd, soap::proxy_port, soap::proxy_userid, soap::randfile, soap::recv_timeout, soap::recvfd, soap::send_timeout, soap::sendfd, soap::session, soap_begin(), soap_imode, SOAP_INIT, soap_init_iht(), soap_init_logs(), soap_init_pht(), SOAP_INVALID_SOCKET, SOAP_IO_DEFAULT, SOAP_MALLOC, SOAP_MAXKEEPALIVE, soap_omode, soap_poll(), SOAP_SSL_DEFAULT, soap_ssl_init(), SOAP_STR_EOS, SOAP_ZLIB_NONE, soap::socket, soap::socket_flags, soap::ssl, soap::ssl_flags, soap_mime::start, soap::state, tcp_accept(), tcp_closesocket(), tcp_connect(), tcp_disconnect(), tcp_gethost(), soap::tcp_keep_alive, soap::tcp_keep_cnt, soap::tcp_keep_idle, soap::tcp_keep_intvl, tcp_shutdownsocket(), soap::user, soap::userid, soap::version, soap::xlist, soap::z_buf, soap::z_level, soap::zlib_in, soap::zlib_out, and soap::zlib_state.

Referenced by soap_init2().

8442  {
8443  soap->state = SOAP_INIT;
8444 #ifdef SOAP_MEM_DEBUG
8445  soap_init_mht(soap);
8446 #endif
8447 #if !defined(WITH_LEAN) || defined(SOAP_DEBUG)
8449 #endif
8450 #ifdef SOAP_DEBUG
8451  soap_set_test_logfile(soap, "TEST.log");
8452  soap_set_sent_logfile(soap, "SENT.log");
8453  soap_set_recv_logfile(soap, "RECV.log");
8454  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing context\n"));
8455 #endif
8456  soap->version = 0;
8459  soap->plugins = NULL;
8460  soap->user = NULL;
8461  soap->userid = NULL;
8462  soap->passwd = NULL;
8463 #ifndef WITH_NOHTTP
8464  soap->fpost = http_post;
8465  soap->fget = http_get;
8466  soap->fput = http_put;
8467  soap->fdel = http_del;
8468  soap->fhead = http_head;
8469  soap->fform = NULL;
8472  soap->fparse = http_parse;
8474 #endif
8475  soap->fheader = NULL;
8476  soap->fconnect = NULL;
8477  soap->fdisconnect = NULL;
8478 #ifndef WITH_NOIO
8479  soap->ipv6_multicast_if = 0;
8480  soap->ipv4_multicast_if = NULL;
8481 #ifndef WITH_IPV6
8483 #else
8484  soap->fresolve = NULL;
8485 #endif
8486  soap->faccept = tcp_accept;
8487  soap->fopen = tcp_connect;
8491  soap->fsend = fsend;
8492  soap->frecv = frecv;
8493  soap->fpoll = soap_poll;
8494 #else
8495  soap->fopen = NULL;
8496  soap->fclose = NULL;
8497  soap->fpoll = NULL;
8498 #endif
8499  soap->fseterror = NULL;
8500  soap->fignore = NULL;
8501  soap->fserveloop = NULL;
8502  soap->fplugin = fplugin;
8503  soap->fmalloc = NULL;
8504 #ifndef WITH_LEANER
8505  soap->fprepareinit = NULL;
8506  soap->fpreparesend = NULL;
8507  soap->fpreparerecv = NULL;
8508  soap->fpreparefinal = NULL;
8509  soap->fdimereadopen = NULL;
8510  soap->fdimewriteopen = NULL;
8511  soap->fdimereadclose = NULL;
8512  soap->fdimewriteclose = NULL;
8513  soap->fdimeread = NULL;
8514  soap->fdimewrite = NULL;
8515  soap->fmimereadopen = NULL;
8516  soap->fmimewriteopen = NULL;
8517  soap->fmimereadclose = NULL;
8518  soap->fmimewriteclose = NULL;
8519  soap->fmimeread = NULL;
8520  soap->fmimewrite = NULL;
8521 #endif
8522  soap->float_format = "%.9G"; /* Alternative: use "%G" */
8523  soap->double_format = "%.17lG"; /* Alternative: use "%lG" */
8524  soap->dime_id_format = "cid:id%d"; /* default DIME id format */
8525  soap->http_version = "1.1";
8526  soap->proxy_http_version = "1.0";
8527  soap->http_content = NULL;
8528  soap->actor = NULL;
8529  soap->lang = "en";
8530  soap->keep_alive = 0;
8531  soap->tcp_keep_alive = 0;
8532  soap->tcp_keep_idle = 0;
8533  soap->tcp_keep_intvl = 0;
8534  soap->tcp_keep_cnt = 0;
8536  soap->recv_timeout = 0;
8537  soap->send_timeout = 0;
8538  soap->connect_timeout = 0;
8539  soap->accept_timeout = 0;
8540  soap->socket_flags = 0;
8541  soap->connect_flags = 0;
8542  soap->bind_flags = 0;
8543  soap->accept_flags = 0;
8544  soap->linger_time = 0;
8545  soap->ip = 0;
8546  soap->labbuf = NULL;
8547  soap->lablen = 0;
8548  soap->labidx = 0;
8550 #ifndef WITH_NONAMESPACES
8552 #else
8553  soap->namespaces = NULL;
8554 #endif
8555  soap->local_namespaces = NULL;
8556  soap->nlist = NULL;
8557  soap->blist = NULL;
8558  soap->clist = NULL;
8559  soap->alist = NULL;
8560  soap->attributes = NULL;
8561  soap->header = NULL;
8562  soap->fault = NULL;
8565  soap->os = NULL;
8566  soap->is = NULL;
8567 #ifndef WITH_LEANER
8568  soap->dom = NULL;
8569  soap->dime.list = NULL;
8570  soap->dime.first = NULL;
8571  soap->dime.last = NULL;
8572  soap->mime.list = NULL;
8573  soap->mime.first = NULL;
8574  soap->mime.last = NULL;
8575  soap->mime.boundary = NULL;
8576  soap->mime.start = NULL;
8577  soap->xlist = NULL;
8578 #endif
8579 #ifndef UNDER_CE
8580  soap->recvfd = 0;
8581  soap->sendfd = 1;
8582 #else
8583  soap->recvfd = stdin;
8584  soap->sendfd = stdout;
8585 #endif
8586  soap->host[0] = '\0';
8587  soap->port = 0;
8588  soap->action = NULL;
8589  soap->proxy_host = NULL;
8590  soap->proxy_port = 8080;
8591  soap->proxy_userid = NULL;
8592  soap->proxy_passwd = NULL;
8593  soap->authrealm = NULL;
8594  soap->prolog = NULL;
8595 #ifdef WITH_ZLIB
8599  soap->d_stream = (z_stream*)SOAP_MALLOC(soap, sizeof(z_stream));
8600  soap->d_stream->zalloc = Z_NULL;
8601  soap->d_stream->zfree = Z_NULL;
8602  soap->d_stream->opaque = Z_NULL;
8603  soap->z_buf = NULL;
8604  soap->z_level = 6;
8605 #endif
8606 #ifndef WITH_LEAN
8607  soap->c14ninclude = NULL;
8608  soap->c14nexclude = NULL;
8609  soap->cookies = NULL;
8610  soap->cookie_domain = NULL;
8611  soap->cookie_path = NULL;
8612  soap->cookie_max = 32;
8613 #endif
8614 #ifdef WMW_RPM_IO
8615  soap->rpmreqid = NULL;
8616 #endif
8617 #ifdef PALM
8618  palmNetLibOpen();
8619 #endif
8620 #ifndef WITH_NOIDREF
8623 #endif
8624 #ifdef WITH_OPENSSL
8625 
8626  if (!soap_ssl_init_done)
8627  {
8628  soap_ssl_init();
8629  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing OpenSSL, version=%ld\n", (long)OPENSSL_VERSION_NUMBER));
8630  }
8631 
8632  soap->fsslauth = ssl_auth_init;
8633  soap->fsslverify = ssl_verify_callback;
8634  soap->bio = NULL;
8635  soap->ssl = NULL;
8636  soap->ctx = NULL;
8638  soap->keyfile = NULL;
8639  soap->password = NULL;
8640  soap->dhfile = NULL;
8641  soap->cafile = NULL;
8642  soap->capath = NULL;
8643  soap->crlfile = NULL;
8644  soap->randfile = NULL;
8645  soap->session = NULL;
8646 #endif
8647 #ifdef WITH_C_LOCALE
8648  soap->c_locale = newlocale(LC_ALL_MASK, "C", NULL);
8649 #else
8650  soap->c_locale = NULL;
8651 #endif
8652  soap_begin(soap);
8653  }
int(* fheader)(struct soap *)
Definition: stdsoap2.h:1648
size_t(* frecv)(struct soap *, char *, size_t)
Definition: stdsoap2.h:1658
static void soap_init_logs(struct soap *)
Definition: stdsoap2.cpp:8154
void(* fdimewriteclose)(struct soap *, void *)
Definition: stdsoap2.h:1673
void *(* fdimereadopen)(struct soap *, void *, const char *, const char *, const char *)
Definition: stdsoap2.h:1670
size_t lablen
Definition: stdsoap2.h:1708
#define soap_imode(soap, n)
Definition: stdsoap2.h:1902
short keep_alive
Definition: stdsoap2.h:1742
struct soap_blist * blist
Definition: stdsoap2.h:1624
char * prolog
Definition: stdsoap2.h:1739
void *(* fplugin)(struct soap *, const char *)
Definition: stdsoap2.h:1663
const char * cookie_domain
Definition: stdsoap2.h:1773
void * is
Definition: stdsoap2.h:1690
int socket_flags
Definition: stdsoap2.h:1616
int recvfd
Definition: stdsoap2.h:1694
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
const char * dime_id_format
Definition: stdsoap2.h:1606
const char * cafile
Definition: stdsoap2.h:1807
void *(* fmimereadopen)(struct soap *, void *, const char *, const char *, const char *)
Definition: stdsoap2.h:1676
unsigned short z_level
Definition: stdsoap2.h:1830
struct soap_multipart * first
Definition: stdsoap2.h:1413
struct soap_plugin * plugins
Definition: stdsoap2.h:1635
unsigned long ip
Definition: stdsoap2.h:1740
struct soap_multipart * list
Definition: stdsoap2.h:1412
static int http_post_header(struct soap *, const char *, const char *)
Definition: stdsoap2.cpp:18535
int(* faccept)(struct soap *, int, struct sockaddr *, int *n)
Definition: stdsoap2.h:1655
const char * dhfile
Definition: stdsoap2.h:1806
unsigned int tcp_keep_idle
Definition: stdsoap2.h:1744
void(* fmimereadclose)(struct soap *, void *)
Definition: stdsoap2.h:1678
int sendfd
Definition: stdsoap2.h:1693
void * fsslverify
Definition: stdsoap2.h:1797
char * action
Definition: stdsoap2.h:1737
const char * randfile
Definition: stdsoap2.h:1810
struct soap_multipart * first
Definition: stdsoap2.h:1397
static void soap_init_iht(struct soap *)
Definition: stdsoap2.cpp:6989
int(* fpost)(struct soap *, const char *, const char *, int, const char *, const char *, size_t)
Definition: stdsoap2.h:1638
int(* fserveloop)(struct soap *)
Definition: stdsoap2.h:1662
static int http_response(struct soap *, int, size_t)
Definition: stdsoap2.cpp:18555
const char * http_version
Definition: stdsoap2.h:1607
int(* fdisconnect)(struct soap *)
Definition: stdsoap2.h:1651
const char * c14nexclude
Definition: stdsoap2.h:1771
static int http_head(struct soap *)
Definition: stdsoap2.cpp:18383
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
static void soap_init_pht(struct soap *)
Definition: stdsoap2.cpp:6168
static int tcp_gethost(struct soap *, const char *addr, struct in_addr *inaddr)
Definition: stdsoap2.cpp:4560
#define SOAP_IO_DEFAULT
Definition: stdsoap2.h:1127
#define SOAP_INIT
Definition: stdsoap2.h:1147
int(* fhead)(struct soap *)
Definition: stdsoap2.h:1642
short version
Definition: stdsoap2.h:1600
int accept_timeout
Definition: stdsoap2.h:1615
static int http_del(struct soap *)
Definition: stdsoap2.cpp:18372
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
const struct Namespace * namespaces
Definition: stdsoap2.h:1621
const char * proxy_host
Definition: stdsoap2.h:1749
#define SOAP_ZLIB_NONE
Definition: stdsoap2.h:1077
struct soap_multipart * list
Definition: stdsoap2.h:1396
struct soap_clist * clist
Definition: stdsoap2.h:1625
struct soap_dime dime
Definition: stdsoap2.h:1760
#define SOAP_MAXKEEPALIVE
Definition: stdsoap2.h:877
size_t(* fdimeread)(struct soap *, void *, char *, size_t)
Definition: stdsoap2.h:1674
short zlib_state
Definition: stdsoap2.h:1825
int(* fpoll)(struct soap *)
Definition: stdsoap2.h:1659
int(* fform)(struct soap *)
Definition: stdsoap2.h:1643
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
static int tcp_closesocket(struct soap *, int)
Definition: stdsoap2.cpp:6096
char * authrealm
Definition: stdsoap2.h:1738
const char * actor
Definition: stdsoap2.h:1610
static int http_put(struct soap *)
Definition: stdsoap2.cpp:18361
int soap_poll(struct soap *soap)
Definition: stdsoap2.cpp:5673
int(* fresolve)(struct soap *, const char *, struct in_addr *inaddr)
Definition: stdsoap2.h:1649
static int http_parse_header(struct soap *, const char *, const char *)
Definition: stdsoap2.cpp:17127
void * bio
Definition: stdsoap2.h:1798
const char * proxy_http_version
Definition: stdsoap2.h:1748
static int http_get(struct soap *)
Definition: stdsoap2.cpp:18350
void * d_stream
Definition: stdsoap2.h:1822
int(* fdel)(struct soap *)
Definition: stdsoap2.h:1641
const char * http_content
Definition: stdsoap2.h:1608
void soap_begin(struct soap *soap)
Definition: stdsoap2.cpp:8685
int master
Definition: stdsoap2.h:1683
int(* fshutdownsocket)(struct soap *, int, int)
Definition: stdsoap2.h:1653
int(* fpreparesend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1667
char * ipv4_multicast_if
Definition: stdsoap2.h:1779
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
int(* fposthdr)(struct soap *, const char *, const char *)
Definition: stdsoap2.h:1644
int(* fpreparefinal)(struct soap *)
Definition: stdsoap2.h:1669
int(* fdimewrite)(struct soap *, void *, const char *, size_t)
Definition: stdsoap2.h:1675
void * ssl
Definition: stdsoap2.h:1799
void *(* fdimewriteopen)(struct soap *, const char *, const char *, const char *)
Definition: stdsoap2.h:1671
int send_timeout
Definition: stdsoap2.h:1613
void * alist
Definition: stdsoap2.h:1626
void * c_locale
Definition: stdsoap2.h:1816
size_t(* fmimeread)(struct soap *, void *, char *, size_t)
Definition: stdsoap2.h:1680
int bind_flags
Definition: stdsoap2.h:1618
int(* fclosesocket)(struct soap *, int)
Definition: stdsoap2.h:1652
const char * start
Definition: stdsoap2.h:1411
int ipv6_multicast_if
Definition: stdsoap2.h:1778
void * fsslauth
Definition: stdsoap2.h:1796
const char * proxy_userid
Definition: stdsoap2.h:1751
void * user
Definition: stdsoap2.h:1634
struct SOAP_ENV__Header * header
Definition: stdsoap2.h:1631
const char * proxy_passwd
Definition: stdsoap2.h:1752
static size_t frecv(struct soap *, char *, size_t)
Definition: stdsoap2.cpp:1005
int(* fput)(struct soap *)
Definition: stdsoap2.h:1640
struct soap_multipart * last
Definition: stdsoap2.h:1397
void(* fseterror)(struct soap *, const char **c, const char **s)
Definition: stdsoap2.h:1660
char host[(1024)]
Definition: stdsoap2.h:1736
size_t labidx
Definition: stdsoap2.h:1709
struct Namespace namespaces[]
struct soap_multipart * last
Definition: stdsoap2.h:1413
char * labbuf
Definition: stdsoap2.h:1707
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
int connect_flags
Definition: stdsoap2.h:1617
static int tcp_shutdownsocket(struct soap *, int, int)
Definition: stdsoap2.cpp:6108
int(* fconnect)(struct soap *, const char *, const char *, int)
Definition: stdsoap2.h:1650
int recv_timeout
Definition: stdsoap2.h:1612
int(* fsend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1657
static int fsend(struct soap *, const char *, size_t)
Definition: stdsoap2.cpp:526
unsigned short ssl_flags
Definition: stdsoap2.h:1803
int port
Definition: stdsoap2.h:1741
int(* fparsehdr)(struct soap *, const char *, const char *)
Definition: stdsoap2.h:1647
short state
Definition: stdsoap2.h:1599
#define SOAP_INVALID_SOCKET
Definition: stdsoap2.h:697
char * boundary
Definition: stdsoap2.h:1410
void * ctx
Definition: stdsoap2.h:1800
int(* fprepareinit)(struct soap *)
Definition: stdsoap2.h:1666
void * os
Definition: stdsoap2.h:1689
const char * float_format
Definition: stdsoap2.h:1604
static int http_post(struct soap *, const char *, const char *, int, const char *, const char *, size_t)
Definition: stdsoap2.cpp:18394
int(* fmimewrite)(struct soap *, void *, const char *, size_t)
Definition: stdsoap2.h:1681
unsigned int max_keep_alive
Definition: stdsoap2.h:1747
short zlib_in
Definition: stdsoap2.h:1826
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
char * z_buf
Definition: stdsoap2.h:1828
const char * keyfile
Definition: stdsoap2.h:1804
int(* fresponse)(struct soap *, int, size_t)
Definition: stdsoap2.h:1645
char * userid
Definition: stdsoap2.h:1636
int cookie_max
Definition: stdsoap2.h:1775
short tcp_keep_alive
Definition: stdsoap2.h:1743
const char * lang
Definition: stdsoap2.h:1611
struct soap_xlist * xlist
Definition: stdsoap2.h:1762
#define soap_omode(soap, n)
Definition: stdsoap2.h:1905
void(* fdimereadclose)(struct soap *, void *)
Definition: stdsoap2.h:1672
int connect_timeout
Definition: stdsoap2.h:1614
int proxy_port
Definition: stdsoap2.h:1750
const char * cookie_path
Definition: stdsoap2.h:1774
const char * password
Definition: stdsoap2.h:1805
int(* fpreparerecv)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1668
const char * c14ninclude
Definition: stdsoap2.h:1770
struct soap_mime mime
Definition: stdsoap2.h:1761
void *(* fmalloc)(struct soap *, size_t)
Definition: stdsoap2.h:1664
int(* fclose)(struct soap *)
Definition: stdsoap2.h:1656
static int tcp_connect(struct soap *, const char *endpoint, const char *host, int port)
Definition: stdsoap2.cpp:4648
unsigned short linger_time
Definition: stdsoap2.h:1620
int socket
Definition: stdsoap2.h:1684
unsigned int tcp_keep_cnt
Definition: stdsoap2.h:1746
int(* fignore)(struct soap *, const char *)
Definition: stdsoap2.h:1661
const char * crlfile
Definition: stdsoap2.h:1809
const char * capath
Definition: stdsoap2.h:1808
const char * double_format
Definition: stdsoap2.h:1605
int(* fget)(struct soap *)
Definition: stdsoap2.h:1639
void(* fmimewriteclose)(struct soap *, void *)
Definition: stdsoap2.h:1679
unsigned int tcp_keep_intvl
Definition: stdsoap2.h:1745
static int tcp_accept(struct soap *, int, struct sockaddr *, int *)
Definition: stdsoap2.cpp:5755
int accept_flags
Definition: stdsoap2.h:1619
static int http_parse(struct soap *)
Definition: stdsoap2.cpp:16921
#define SOAP_SSL_DEFAULT
Definition: stdsoap2.h:1142
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
int(* fparse)(struct soap *)
Definition: stdsoap2.h:1646
struct soap_cookie * cookies
Definition: stdsoap2.h:1772
char * passwd
Definition: stdsoap2.h:1637
const char * encodingStyle
Definition: stdsoap2.h:1609
void * session
Definition: stdsoap2.h:1801
int(* fopen)(struct soap *, const char *, const char *, int)
Definition: stdsoap2.h:1654
short zlib_out
Definition: stdsoap2.h:1827
void soap_ssl_init()
void *(* fmimewriteopen)(struct soap *, void *, const char *, const char *, const char *, enum soap_mime_encoding)
Definition: stdsoap2.h:1677
static int tcp_disconnect(struct soap *)
Definition: stdsoap2.cpp:5982
static void * fplugin(struct soap *, const char *)
Definition: stdsoap2.cpp:19476
void soap_init1 ( struct soap ,
soap_mode   
)

Definition at line 8661 of file stdsoap2.cpp.

References soap_init2().

8662  {
8663  soap_init2(soap, mode, mode);
8664  }
void soap_init2(struct soap *soap, soap_mode imode, soap_mode omode)
Definition: stdsoap2.cpp:8672
void soap_init2 ( struct soap ,
soap_mode  ,
soap_mode   
)

Definition at line 8672 of file stdsoap2.cpp.

References soap_imode, soap_init(), and soap_omode.

Referenced by soap_init1(), and soap_new2().

8673  {
8674  soap_init(soap);
8675  soap_imode(soap, imode);
8676  soap_omode(soap, omode);
8677  }
#define soap_imode(soap, n)
Definition: stdsoap2.h:1902
void soap_init(struct soap *soap)
Definition: stdsoap2.cpp:8441
#define soap_omode(soap, n)
Definition: stdsoap2.h:1905
char** soap_inliteral ( struct soap ,
const char *  tag,
char **  p 
)

Definition at line 14078 of file stdsoap2.cpp.

References soap::body, soap::error, soap::null, soap_element_begin_in(), soap_element_end_in(), soap_get(), soap_malloc(), SOAP_NO_TAG, SOAP_OK, SOAP_STR_EOS, soap_strdup(), soap_string_in(), SOAP_TT, and soap_unget.

Referenced by soap_in_SOAP_ENV__Detail().

14079  {
14080  if (soap_element_begin_in(soap, tag, 1, NULL))
14081  {
14083  return NULL;
14084 
14085  soap->error = SOAP_OK;
14086  }
14087 
14088  if (!p)
14089  {
14090  if (!(p = (char**)soap_malloc(soap, sizeof(char*))))
14091  return NULL;
14092  }
14093 
14094  if (soap->body || (tag && *tag == '-'))
14095  {
14096  *p = soap_string_in(soap, 0, -1, -1);
14097 
14098  if (!*p)
14099  return NULL;
14100 
14101  if (!**p && tag && *tag == '-')
14102  {
14103  soap->error = SOAP_NO_TAG;
14104  return NULL;
14105  }
14106  }
14107  else if (soap->null)
14108  *p = NULL;
14109  else
14110  *p = soap_strdup(soap, SOAP_STR_EOS);
14111 
14112  if (soap->body && soap_element_end_in(soap, tag))
14113  return NULL;
14114 
14115  return p;
14116  }
soap_wchar soap_get(struct soap *soap)
Definition: stdsoap2.cpp:1856
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
#define SOAP_NO_TAG
Definition: stdsoap2.h:1001
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
#define SOAP_TT
Definition: stdsoap2.cpp:113
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
char * soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
Definition: stdsoap2.cpp:11015
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
short body
Definition: stdsoap2.h:1703
short null
Definition: stdsoap2.h:1727
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
long* soap_inlong ( struct soap ,
const char *  tag,
long *  p,
const char *  ,
int   
)

Definition at line 12105 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2long(), SOAP_TYPE, soap_value(), and soap::type.

12106  {
12107  if (soap_element_begin_in(soap, tag, 0, NULL))
12108  return NULL;
12109 
12110 #ifndef WITH_LEAN
12111 
12112  if (*soap->type
12114  && soap_match_tag(soap, soap->type, ":int")
12115  && soap_match_tag(soap, soap->type, ":short")
12116  && soap_match_tag(soap, soap->type, ":byte"))
12117  {
12118  soap->error = SOAP_TYPE;
12119  soap_revert(soap);
12120  return NULL;
12121  }
12122 
12123 #endif
12124  p = (long*)soap_id_enter(soap, soap->id, p, t, sizeof(long), 0, NULL, NULL, NULL);
12125 
12126  if (*soap->href)
12127  p = (long*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(long), 0, NULL);
12128  else if (p)
12129  {
12130  if (soap_s2long(soap, soap_value(soap), p))
12131  return NULL;
12132  }
12133 
12134  if (soap->body && soap_element_end_in(soap, tag))
12135  return NULL;
12136 
12137  return p;
12138  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_s2long(struct soap *soap, const char *s, long *p)
Definition: stdsoap2.cpp:12074
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
long long* soap_inLONG64 ( struct soap ,
const char *  tag,
long long *  p,
const char *  ,
int   
)

Definition at line 12210 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, LONG64, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2LONG64(), SOAP_TYPE, soap_value(), and soap::type.

12211  {
12212  if (soap_element_begin_in(soap, tag, 0, NULL))
12213  return NULL;
12214 
12215 #ifndef WITH_LEAN
12216 
12217  if (*soap->type
12219  && soap_match_tag(soap, soap->type, ":integer")
12220  && soap_match_tag(soap, soap->type, ":positiveInteger")
12221  && soap_match_tag(soap, soap->type, ":negativeInteger")
12222  && soap_match_tag(soap, soap->type, ":nonPositiveInteger")
12223  && soap_match_tag(soap, soap->type, ":nonNegativeInteger")
12224  && soap_match_tag(soap, soap->type, ":long")
12225  && soap_match_tag(soap, soap->type, ":int")
12226  && soap_match_tag(soap, soap->type, ":short")
12227  && soap_match_tag(soap, soap->type, ":byte"))
12228  {
12229  soap->error = SOAP_TYPE;
12230  soap_revert(soap);
12231  return NULL;
12232  }
12233 
12234 #endif
12235  p = (LONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(LONG64), 0, NULL, NULL, NULL);
12236 
12237  if (*soap->href)
12238  p = (LONG64*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(LONG64), 0, NULL);
12239  else if (p)
12240  {
12241  if (soap_s2LONG64(soap, soap_value(soap), p))
12242  return NULL;
12243  }
12244 
12245  if (soap->body && soap_element_end_in(soap, tag))
12246  return NULL;
12247 
12248  return p;
12249  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
#define LONG64
Definition: stdsoap2.h:733
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
int soap_s2LONG64(struct soap *soap, const char *s, long long *p)
Definition: stdsoap2.cpp:12173
short* soap_inshort ( struct soap ,
const char *  tag,
short *  p,
const char *  ,
int   
)

Definition at line 12394 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2short(), SOAP_TYPE, soap_value(), and soap::type.

12395  {
12396  if (soap_element_begin_in(soap, tag, 0, NULL))
12397  return NULL;
12398 
12399 #ifndef WITH_LEAN
12400 
12401  if (*soap->type
12403  && soap_match_tag(soap, soap->type, ":short")
12404  && soap_match_tag(soap, soap->type, ":byte"))
12405  {
12406  soap->error = SOAP_TYPE;
12407  soap_revert(soap);
12408  return NULL;
12409  }
12410 
12411 #endif
12412  p = (short*)soap_id_enter(soap, soap->id, p, t, sizeof(short), 0, NULL, NULL, NULL);
12413 
12414  if (*soap->href)
12415  p = (short*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(short), 0, NULL);
12416  else if (p)
12417  {
12418  if (soap_s2short(soap, soap_value(soap), p))
12419  return NULL;
12420  }
12421 
12422  if (soap->body && soap_element_end_in(soap, tag))
12423  return NULL;
12424 
12425  return p;
12426  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
int soap_s2short(struct soap *soap, const char *s, short *p)
Definition: stdsoap2.cpp:12371
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
char** soap_instring ( struct soap ,
const char *  tag,
char **  p,
const char *  ,
int  ,
int  ,
long  ,
long   
)

Definition at line 13625 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap::null, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_lookup(), soap_malloc(), SOAP_NO_TAG, SOAP_OK, SOAP_STR_EOS, soap_strdup(), and soap_string_in().

Referenced by soap_check_result(), soap_in__QName(), and soap_in_string().

13626  {
13627  if (soap_element_begin_in(soap, tag, 1, NULL))
13628  {
13629  if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG)
13630  return NULL;
13631 
13632  soap->error = SOAP_OK;
13633  }
13634 
13635  if (!p)
13636  {
13637  if (!(p = (char**)soap_malloc(soap, sizeof(char*))))
13638  return NULL;
13639  }
13640 
13641  if (soap->null)
13642  *p = NULL;
13643  else if (soap->body)
13644  {
13645  *p = soap_string_in(soap, flag, minlen, maxlen);
13646 
13647  if (!*p || !(char*)soap_id_enter(soap, soap->id, *p, t, sizeof(char*), 0, NULL, NULL, NULL))
13648  return NULL;
13649 
13650  if (!**p && tag && *tag == '-')
13651  {
13652  soap->error = SOAP_NO_TAG;
13653  return NULL;
13654  }
13655  }
13656  else if (tag && *tag == '-')
13657  {
13658  soap->error = SOAP_NO_TAG;
13659  return NULL;
13660  }
13661  else
13662  *p = soap_strdup(soap, SOAP_STR_EOS);
13663 
13664  if (*soap->href)
13665  p = (char**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(char**), 0);
13666 
13667  if (soap->body && soap_element_end_in(soap, tag))
13668  return NULL;
13669 
13670  return p;
13671  }
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
#define SOAP_NO_TAG
Definition: stdsoap2.h:1001
char href[(1024)]
Definition: stdsoap2.h:1715
void * soap_id_lookup(struct soap *soap, const char *id, void **p, int t, size_t n, unsigned int k)
Definition: stdsoap2.cpp:7471
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
char * soap_string_in(struct soap *soap, int flag, long minlen, long maxlen)
Definition: stdsoap2.cpp:11015
long int flag
Definition: f2c.h:52
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
short body
Definition: stdsoap2.h:1703
short null
Definition: stdsoap2.h:1727
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
const char* soap_int2s ( struct soap ,
int   
)

Definition at line 11949 of file stdsoap2.cpp.

References soap_long2s().

Referenced by soap_bind(), and tcp_connect().

11950  {
11951  return soap_long2s(soap, (long)n);
11952  }
const char * soap_long2s(struct soap *soap, long n)
Definition: stdsoap2.cpp:12047
unsigned long long* soap_inULONG64 ( struct soap ,
const char *  tag,
unsigned long long *  p,
const char *  ,
int   
)

Definition at line 13190 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2ULONG64(), SOAP_TYPE, soap_value(), soap::type, and ULONG64.

13191  {
13192  if (soap_element_begin_in(soap, tag, 0, NULL))
13193  return NULL;
13194 
13195  if (*soap->type
13197  && soap_match_tag(soap, soap->type, ":positiveInteger")
13198  && soap_match_tag(soap, soap->type, ":nonNegativeInteger")
13199  && soap_match_tag(soap, soap->type, ":unsignedLong")
13200  && soap_match_tag(soap, soap->type, ":unsignedInt")
13201  && soap_match_tag(soap, soap->type, ":unsignedShort")
13202  && soap_match_tag(soap, soap->type, ":unsignedByte"))
13203  {
13204  soap->error = SOAP_TYPE;
13205  soap_revert(soap);
13206  return NULL;
13207  }
13208 
13209  p = (ULONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(ULONG64), 0, NULL, NULL, NULL);
13210 
13211  if (*soap->href)
13212  p = (ULONG64*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(ULONG64), 0, NULL);
13213  else if (p)
13214  {
13215  if (soap_s2ULONG64(soap, soap_value(soap), p))
13216  return NULL;
13217  }
13218 
13219  if (soap->body && soap_element_end_in(soap, tag))
13220  return NULL;
13221 
13222  return p;
13223  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
int soap_s2ULONG64(struct soap *soap, const char *s, unsigned long long *p)
Definition: stdsoap2.cpp:13153
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
#define ULONG64
Definition: stdsoap2.h:734
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
unsigned char* soap_inunsignedByte ( struct soap ,
const char *  tag,
unsigned char *  p,
const char *  ,
int   
)

Definition at line 12801 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2unsignedByte(), SOAP_TYPE, soap_value(), and soap::type.

12802  {
12803  if (soap_element_begin_in(soap, tag, 0, NULL))
12804  return NULL;
12805 
12806 #ifndef WITH_LEAN
12807 
12808  if (*soap->type
12810  && soap_match_tag(soap, soap->type, ":unsignedByte"))
12811  {
12812  soap->error = SOAP_TYPE;
12813  soap_revert(soap);
12814  return NULL;
12815  }
12816 
12817 #endif
12818  p = (unsigned char*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned char), 0, NULL, NULL, NULL);
12819 
12820  if (*soap->href)
12821  p = (unsigned char*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(unsigned char), 0, NULL);
12822  else if (p)
12823  {
12825  return NULL;
12826  }
12827 
12828  if (soap->body && soap_element_end_in(soap, tag))
12829  return NULL;
12830 
12831  return p;
12832  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
int soap_s2unsignedByte(struct soap *soap, const char *s, unsigned char *p)
Definition: stdsoap2.cpp:12778
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
unsigned int* soap_inunsignedInt ( struct soap ,
const char *  tag,
unsigned int *  p,
const char *  ,
int   
)

Definition at line 12986 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2unsignedInt(), SOAP_TYPE, soap_value(), and soap::type.

12987  {
12988  if (soap_element_begin_in(soap, tag, 0, NULL))
12989  return NULL;
12990 
12991 #ifndef WITH_LEAN
12992 
12993  if (*soap->type
12995  && soap_match_tag(soap, soap->type, ":unsignedInt")
12996  && soap_match_tag(soap, soap->type, ":unsignedShort")
12997  && soap_match_tag(soap, soap->type, ":unsignedByte"))
12998  {
12999  soap->error = SOAP_TYPE;
13000  soap_revert(soap);
13001  return NULL;
13002  }
13003 
13004 #endif
13005  p = (unsigned int*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned int), 0, NULL, NULL, NULL);
13006 
13007  if (*soap->href)
13008  p = (unsigned int*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(unsigned int), 0, NULL);
13009  else if (p)
13010  {
13012  return NULL;
13013  }
13014 
13015  if (soap->body && soap_element_end_in(soap, tag))
13016  return NULL;
13017 
13018  return p;
13019  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
int soap_s2unsignedInt(struct soap *soap, const char *s, unsigned int *p)
Definition: stdsoap2.cpp:12955
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
unsigned long* soap_inunsignedLong ( struct soap ,
const char *  tag,
unsigned long *  p,
const char *  ,
int   
)

Definition at line 13085 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2unsignedLong(), SOAP_TYPE, soap_value(), and soap::type.

13086  {
13087  if (soap_element_begin_in(soap, tag, 0, NULL))
13088  return NULL;
13089 
13090 #ifndef WITH_LEAN
13091 
13092  if (*soap->type
13094  && soap_match_tag(soap, soap->type, ":unsignedInt")
13095  && soap_match_tag(soap, soap->type, ":unsignedShort")
13096  && soap_match_tag(soap, soap->type, ":unsignedByte"))
13097  {
13098  soap->error = SOAP_TYPE;
13099  soap_revert(soap);
13100  return NULL;
13101  }
13102 
13103 #endif
13104  p = (unsigned long*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned long), 0, NULL, NULL, NULL);
13105 
13106  if (*soap->href)
13107  p = (unsigned long*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(unsigned long), 0, NULL);
13108  else if (p)
13109  {
13111  return NULL;
13112  }
13113 
13114  if (soap->body && soap_element_end_in(soap, tag))
13115  return NULL;
13116 
13117  return p;
13118  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
int soap_s2unsignedLong(struct soap *soap, const char *s, unsigned long *p)
Definition: stdsoap2.cpp:13054
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
unsigned short* soap_inunsignedShort ( struct soap ,
const char *  tag,
unsigned short *  p,
const char *  ,
int   
)

Definition at line 12889 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_forward(), soap_match_tag(), soap_revert(), soap_s2unsignedShort(), SOAP_TYPE, soap_value(), and soap::type.

12890  {
12891  if (soap_element_begin_in(soap, tag, 0, NULL))
12892  return NULL;
12893 
12894 #ifndef WITH_LEAN
12895 
12896  if (*soap->type
12898  && soap_match_tag(soap, soap->type, ":unsignedShort")
12899  && soap_match_tag(soap, soap->type, ":unsignedByte"))
12900  {
12901  soap->error = SOAP_TYPE;
12902  soap_revert(soap);
12903  return NULL;
12904  }
12905 
12906 #endif
12907  p = (unsigned short*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned short), 0, NULL, NULL, NULL);
12908 
12909  if (*soap->href)
12910  p = (unsigned short*)soap_id_forward(soap, soap->href, p, 0, t, 0, sizeof(unsigned short), 0, NULL);
12911  else if (p)
12912  {
12914  return NULL;
12915  }
12916 
12917  if (soap->body && soap_element_end_in(soap, tag))
12918  return NULL;
12919 
12920  return p;
12921  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
int soap_s2unsignedShort(struct soap *soap, const char *s, unsigned short *p)
Definition: stdsoap2.cpp:12866
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
#define SOAP_TYPE
Definition: stdsoap2.h:999
char id[(1024)]
Definition: stdsoap2.h:1714
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
const char * soap_value(struct soap *soap)
Definition: stdsoap2.cpp:14238
char type[(1024)]
Definition: stdsoap2.h:1716
short body
Definition: stdsoap2.h:1703
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void * soap_id_forward(struct soap *soap, const char *href, void *p, size_t len, int st, int tt, size_t n, unsigned int k, void(*fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t))
Definition: stdsoap2.cpp:7589
wchar_t** soap_inwliteral ( struct soap ,
const char *  tag,
wchar_t **  p 
)

Definition at line 14186 of file stdsoap2.cpp.

References soap::body, soap::error, soap::null, soap_element_begin_in(), soap_element_end_in(), soap_get(), soap_malloc(), SOAP_NO_TAG, SOAP_OK, SOAP_STR_EOS, SOAP_TT, soap_unget, soap_wstrdup(), and soap_wstring_in().

14187  {
14188  if (soap_element_begin_in(soap, tag, 1, NULL))
14189  {
14191  return NULL;
14192 
14193  soap->error = SOAP_OK;
14194  }
14195 
14196  if (!p)
14197  {
14198  if (!(p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*))))
14199  return NULL;
14200  }
14201 
14202  if (soap->body)
14203  {
14204  *p = soap_wstring_in(soap, 0, -1, -1);
14205 
14206  if (!*p)
14207  return NULL;
14208 
14209  if (!**p && tag && *tag == '-')
14210  {
14211  soap->error = SOAP_NO_TAG;
14212  return NULL;
14213  }
14214  }
14215  else if (tag && *tag == '-')
14216  {
14217  soap->error = SOAP_NO_TAG;
14218  return NULL;
14219  }
14220  else if (soap->null)
14221  *p = NULL;
14222  else
14223  *p = soap_wstrdup(soap, (wchar_t*)SOAP_STR_EOS);
14224 
14225  if (soap->body && soap_element_end_in(soap, tag))
14226  return NULL;
14227 
14228  return p;
14229  }
wchar_t * soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
Definition: stdsoap2.cpp:11742
soap_wchar soap_get(struct soap *soap)
Definition: stdsoap2.cpp:1856
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
#define SOAP_NO_TAG
Definition: stdsoap2.h:1001
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
#define SOAP_TT
Definition: stdsoap2.cpp:113
wchar_t * soap_wstrdup(struct soap *soap, const wchar_t *s)
Definition: stdsoap2.cpp:2704
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
short body
Definition: stdsoap2.h:1703
short null
Definition: stdsoap2.h:1727
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
wchar_t** soap_inwstring ( struct soap ,
const char *  tag,
wchar_t **  p,
const char *  ,
int  ,
long  ,
long   
)

Definition at line 13706 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap::id, soap::null, soap_element_begin_in(), soap_element_end_in(), soap_id_enter(), soap_id_lookup(), soap_malloc(), SOAP_NO_TAG, SOAP_OK, SOAP_STR_EOS, soap_wstrdup(), and soap_wstring_in().

13707  {
13708  if (soap_element_begin_in(soap, tag, 1, NULL))
13709  {
13710  if (!tag || *tag != '-' || soap->error != SOAP_NO_TAG)
13711  return NULL;
13712 
13713  soap->error = SOAP_OK;
13714  }
13715 
13716  if (!p)
13717  {
13718  if (!(p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*))))
13719  return NULL;
13720  }
13721 
13722  if (soap->body)
13723  {
13724  *p = soap_wstring_in(soap, 1, minlen, maxlen);
13725 
13726  if (!*p || !(wchar_t*)soap_id_enter(soap, soap->id, *p, t, sizeof(wchar_t*), 0, NULL, NULL, NULL))
13727  return NULL;
13728 
13729  if (!**p && tag && *tag == '-')
13730  {
13731  soap->error = SOAP_NO_TAG;
13732  return NULL;
13733  }
13734  }
13735  else if (tag && *tag == '-')
13736  {
13737  soap->error = SOAP_NO_TAG;
13738  return NULL;
13739  }
13740  else if (soap->null)
13741  *p = NULL;
13742  else
13743  *p = soap_wstrdup(soap, (wchar_t*)SOAP_STR_EOS);
13744 
13745  if (*soap->href)
13746  p = (wchar_t**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(wchar_t**), 0);
13747 
13748  if (soap->body && soap_element_end_in(soap, tag))
13749  return NULL;
13750 
13751  return p;
13752  }
wchar_t * soap_wstring_in(struct soap *soap, int flag, long minlen, long maxlen)
Definition: stdsoap2.cpp:11742
void * soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, unsigned int k, const char *type, const char *arrayType, void *(*finstantiate)(struct soap *, int, const char *, const char *, size_t *))
Definition: stdsoap2.cpp:7661
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
#define SOAP_NO_TAG
Definition: stdsoap2.h:1001
char href[(1024)]
Definition: stdsoap2.h:1715
void * soap_id_lookup(struct soap *soap, const char *id, void **p, int t, size_t n, unsigned int k)
Definition: stdsoap2.cpp:7471
char id[(1024)]
Definition: stdsoap2.h:1714
wchar_t * soap_wstrdup(struct soap *soap, const wchar_t *s)
Definition: stdsoap2.cpp:2704
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
short body
Definition: stdsoap2.h:1703
short null
Definition: stdsoap2.h:1727
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
int soap_is_embedded ( struct soap ,
struct soap_plist  
)

Definition at line 6818 of file stdsoap2.cpp.

References DBGLOG, soap::encodingStyle, soap_plist::mark1, soap_plist::mark2, soap::mode, soap::part, SOAP_IN_HEADER, SOAP_IO_LENGTH, SOAP_XML_GRAPH, and soap::version.

Referenced by soap_element_id(), and soap_embed().

6819  {
6820  if (!pp)
6821  return 0;
6822 
6823  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Is embedded? %d %d\n", (int)pp->mark1, (int)pp->mark2));
6824 
6825  if (soap->version == 1 && soap->encodingStyle && !(soap->mode & SOAP_XML_GRAPH) && soap->part != SOAP_IN_HEADER)
6826  {
6827  if (soap->mode & SOAP_IO_LENGTH)
6828  return pp->mark1 != 0;
6829 
6830  return pp->mark2 != 0;
6831  }
6832 
6833  if (soap->mode & SOAP_IO_LENGTH)
6834  return pp->mark1 == 1;
6835 
6836  return pp->mark2 == 1;
6837  }
#define SOAP_XML_GRAPH
Definition: stdsoap2.h:1111
short part
Definition: stdsoap2.h:1729
soap_mode mode
Definition: stdsoap2.h:1601
short version
Definition: stdsoap2.h:1600
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
#define SOAP_IN_HEADER
Definition: stdsoap2.h:1156
const char * encodingStyle
Definition: stdsoap2.h:1609
int soap_is_single ( struct soap ,
struct soap_plist  
)

Definition at line 6847 of file stdsoap2.cpp.

References soap_plist::mark1, soap_plist::mark2, soap::mode, soap::part, SOAP_IN_HEADER, and SOAP_IO_LENGTH.

Referenced by soap_element_id(), and soap_embed().

6848  {
6849  if (soap->part == SOAP_IN_HEADER)
6850  return 1;
6851 
6852  if (!pp)
6853  return 0;
6854 
6855  if (soap->mode & SOAP_IO_LENGTH)
6856  return pp->mark1 == 0;
6857 
6858  return pp->mark2 == 0;
6859  }
short part
Definition: stdsoap2.h:1729
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
#define SOAP_IN_HEADER
Definition: stdsoap2.h:1156
struct soap_clist* soap_link ( struct soap ,
void ,
int  ,
int  ,
int(*)(struct soap_clist *)  fdelete 
)

Definition at line 7380 of file stdsoap2.cpp.

References soap::clist, soap_clist::fdelete, soap_clist::next, soap_clist::ptr, soap_clist::size, SOAP_MALLOC, and soap_clist::type.

Referenced by soap_instantiate_ArrayOf_USCORExsd_USCOREstring(), soap_instantiate_ns2__checkRegExp(), soap_instantiate_ns2__checkRegExpResponse(), soap_instantiate_ns2__getDataResources(), soap_instantiate_ns2__getDataResourcesResponse(), soap_instantiate_ns2__getDataTypeDef(), soap_instantiate_ns2__getDataTypeDefResponse(), soap_instantiate_ns2__getDataTypePattern(), soap_instantiate_ns2__getDataTypePatternResponse(), soap_instantiate_ns2__getDataTypesId(), soap_instantiate_ns2__getDataTypesIdResponse(), soap_instantiate_ns2__getDataTypesName(), soap_instantiate_ns2__getDataTypesNameResponse(), soap_instantiate_ns2__getDataTypeSynonyms(), soap_instantiate_ns2__getDataTypeSynonymsResponse(), soap_instantiate_ns2__getDataTypeURI(), soap_instantiate_ns2__getDataTypeURIResponse(), soap_instantiate_ns2__getDataTypeURIs(), soap_instantiate_ns2__getDataTypeURIsResponse(), soap_instantiate_ns2__getJavaLibraryVersion(), soap_instantiate_ns2__getJavaLibraryVersionResponse(), soap_instantiate_ns2__getLocation(), soap_instantiate_ns2__getLocationResponse(), soap_instantiate_ns2__getLocations(), soap_instantiate_ns2__getLocations_(), soap_instantiate_ns2__getLocationsResponse(), soap_instantiate_ns2__getLocationsResponse_(), soap_instantiate_ns2__getMiriamURI(), soap_instantiate_ns2__getMiriamURIResponse(), soap_instantiate_ns2__getName(), soap_instantiate_ns2__getNameResponse(), soap_instantiate_ns2__getNames(), soap_instantiate_ns2__getNamesResponse(), soap_instantiate_ns2__getOfficialDataTypeURI(), soap_instantiate_ns2__getOfficialDataTypeURIResponse(), soap_instantiate_ns2__getResourceInfo(), soap_instantiate_ns2__getResourceInfoResponse(), soap_instantiate_ns2__getResourceInstitution(), soap_instantiate_ns2__getResourceInstitutionResponse(), soap_instantiate_ns2__getResourceLocation(), soap_instantiate_ns2__getResourceLocationResponse(), soap_instantiate_ns2__getServicesInfo(), soap_instantiate_ns2__getServicesInfoResponse(), soap_instantiate_ns2__getServicesVersion(), soap_instantiate_ns2__getServicesVersionResponse(), soap_instantiate_ns2__getURI(), soap_instantiate_ns2__getURIResponse(), soap_instantiate_ns2__isDeprecated(), soap_instantiate_ns2__isDeprecatedResponse(), soap_instantiate_SOAP_ENV__Code(), soap_instantiate_SOAP_ENV__Detail(), soap_instantiate_SOAP_ENV__Fault(), soap_instantiate_SOAP_ENV__Header(), soap_instantiate_SOAP_ENV__Reason(), and soap_instantiate_std__string().

7381  {
7382  register struct soap_clist *cp;
7383 
7384  if ((cp = (struct soap_clist*)SOAP_MALLOC(soap, sizeof(struct soap_clist))))
7385  {
7386  cp->next = soap->clist;
7387  cp->type = t;
7388  cp->size = n;
7389  cp->ptr = p;
7390  cp->fdelete = fdelete;
7391  soap->clist = cp;
7392  }
7393 
7394  return cp;
7395  }
struct soap_clist * clist
Definition: stdsoap2.h:1625
int(* fdelete)(struct soap_clist *)
Definition: stdsoap2.h:1331
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
void * ptr
Definition: stdsoap2.h:1328
struct soap_clist * next
Definition: stdsoap2.h:1327
const char* soap_long2s ( struct soap ,
long   
)

Definition at line 12047 of file stdsoap2.cpp.

References soap::tmpbuf.

Referenced by soap_byte2s(), soap_int2s(), soap_outbyte(), soap_outint(), soap_outlong(), soap_outshort(), and soap_short2s().

12048  {
12049  sprintf(soap->tmpbuf, "%ld", n);
12050  return soap->tmpbuf;
12051  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
const char* soap_LONG642s ( struct soap ,
long  long 
)

Definition at line 12146 of file stdsoap2.cpp.

References SOAP_LONG_FORMAT, and soap::tmpbuf.

Referenced by soap_outLONG64().

12147  {
12148  sprintf(soap->tmpbuf, SOAP_LONG_FORMAT, n);
12149  return soap->tmpbuf;
12150  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
#define SOAP_LONG_FORMAT
Definition: stdsoap2.h:746
struct soap_ilist* soap_lookup ( struct soap ,
const char *   
)

Definition at line 7037 of file stdsoap2.cpp.

References soap_ilist::id, soap::iht, soap_ilist::next, and soap_hash().

Referenced by soap_id_enter(), soap_id_forward(), soap_id_lookup(), and soap_lookup_type().

7038  {
7039  register struct soap_ilist *ip = NULL;
7040 
7041  for (ip = soap->iht[soap_hash(id)]; ip; ip = ip->next)
7042  if (!strcmp(ip->id, id))
7043  return ip;
7044 
7045  return NULL;
7046  }
struct soap_ilist * next
Definition: stdsoap2.h:1867
char id[1]
Definition: stdsoap2.h:1875
struct soap_ilist * iht[(1999)]
Definition: stdsoap2.h:1627
size_t soap_hash(register const char *s)
Definition: stdsoap2.cpp:6152
struct soap_nlist* soap_lookup_ns ( struct soap soap,
const char *  tag,
size_t  n 
)

Definition at line 8896 of file stdsoap2.cpp.

References soap_nlist::id, soap_nlist::next, and soap::nlist.

Referenced by soap_utilize_ns().

8897  {
8898  register struct soap_nlist *np;
8899 
8900  for (np = soap->nlist; np; np = np->next)
8901  {
8902  if (!strncmp(np->id, tag, n) && !np->id[n])
8903  return np;
8904  }
8905 
8906  return NULL;
8907  }
char id[1]
Definition: stdsoap2.h:1275
struct soap_nlist * next
Definition: stdsoap2.h:1271
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
void* soap_lookup_plugin ( struct soap ,
const char *   
)

Definition at line 19493 of file stdsoap2.cpp.

References soap::fplugin.

19494  {
19495  return soap->fplugin(soap, id);
19496  }
void *(* fplugin)(struct soap *, const char *)
Definition: stdsoap2.h:1663
int soap_lookup_type ( struct soap ,
const char *  id 
)

Definition at line 7444 of file stdsoap2.cpp.

References DBGLOG, soap_lookup(), and soap_ilist::type.

Referenced by soap_getelement().

7445  {
7446  register struct soap_ilist *ip;
7447 
7448  if (id && *id)
7449  {
7450  ip = soap_lookup(soap, id);
7451 
7452  if (ip)
7453  {
7454  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup id='%s' type=%d\n", id, ip->type));
7455  return ip->type;
7456  }
7457  }
7458 
7459  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "lookup type id='%s' NOT FOUND! Need to get it from xsi:type\n", id));
7460  return 0;
7461  }
struct soap_ilist * soap_lookup(struct soap *soap, const char *id)
Definition: stdsoap2.cpp:7037
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
void* soap_malloc ( struct soap ,
size_t   
)

Definition at line 7080 of file stdsoap2.cpp.

References soap::alist, soap::alloced, soap::error, soap::fmalloc, SOAP_CANARY, SOAP_EOM, SOAP_MALLOC, and SOAP_NON_NULL.

Referenced by soap_attachment(), soap_attribute(), soap_base642s(), soap_dime_option(), soap_element(), soap_element_start_end_out(), soap_faultdetail(), soap_getbase64(), soap_getdimefield(), soap_gethex(), soap_hex2s(), soap_id_enter(), soap_id_lookup(), soap_in_PointerToArrayOf_USCORExsd_USCOREstring(), soap_in_PointerToSOAP_ENV__Code(), soap_in_PointerToSOAP_ENV__Detail(), soap_in_PointerToSOAP_ENV__Reason(), soap_in_PointerTostd__string(), soap_inliteral(), soap_instring(), soap_inwliteral(), soap_inwstring(), soap_new_multipart(), soap_peek_element(), soap_resolve(), soap_s2base64(), soap_s2hex(), soap_s2wchar(), soap_save_block(), soap_select_mime_boundary(), soap_strdup(), soap_wchar2s(), soap_wstrdup(), and soap_wstring_out().

7081  {
7082  register char *p;
7083 
7084  if (!n)
7085  return (void*)SOAP_NON_NULL;
7086 
7087  if (!soap)
7088  return SOAP_MALLOC(soap, n);
7089 
7090  if (soap->fmalloc)
7091  p = (char*)soap->fmalloc(soap, n);
7092  else
7093  {
7094  n += sizeof(short);
7095  n += (-(long)n) & (sizeof(void*) - 1); /* align at 4-, 8- or 16-byte boundary */
7096 
7097  if (!(p = (char*)SOAP_MALLOC(soap, n + sizeof(void*) + sizeof(size_t))))
7098  {
7099  soap->error = SOAP_EOM;
7100  return NULL;
7101  }
7102 
7103  /* set the canary to detect corruption */
7104  *(short*)(p + n - sizeof(short)) = (short)SOAP_CANARY;
7105  /* keep chain of alloced cells for destruction */
7106  *(void**)(p + n) = soap->alist;
7107  *(size_t*)(p + n + sizeof(void*)) = n;
7108  soap->alist = p + n;
7109  }
7110 
7111  soap->alloced = 1;
7112  return p;
7113  }
short alloced
Definition: stdsoap2.h:1730
int error
Definition: stdsoap2.h:1755
#define SOAP_NON_NULL
Definition: stdsoap2.cpp:311
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
void * alist
Definition: stdsoap2.h:1626
#define SOAP_CANARY
Definition: stdsoap2.cpp:305
#define SOAP_EOM
Definition: stdsoap2.h:1015
void *(* fmalloc)(struct soap *, size_t)
Definition: stdsoap2.h:1664
int soap_match_array ( struct soap ,
const char *   
)

Definition at line 3791 of file stdsoap2.cpp.

References soap::arrayType, DBGLOG, soap_match_tag(), SOAP_OK, and SOAP_TAG_MISMATCH.

Referenced by soap_getelement(), and soap_in_ArrayOf_USCORExsd_USCOREstring().

3792  {
3793  if (*soap->arrayType)
3795  && soap_match_tag(soap, soap->arrayType, "xsd:anyType")
3796  && soap_match_tag(soap, soap->arrayType, "xsd:ur-type")
3797  )
3798  {
3799  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array type mismatch: '%s' '%s'\n", soap->arrayType, type));
3800  return SOAP_TAG_MISMATCH;
3801  }
3802 
3803  return SOAP_OK;
3804  }
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_TAG_MISMATCH
Definition: stdsoap2.h:998
#define SOAP_OK
Definition: stdsoap2.h:995
char arrayType[(1024)]
Definition: stdsoap2.h:1717
int soap_match_cid ( struct soap ,
const char *  ,
const char *   
)

Definition at line 15216 of file stdsoap2.cpp.

References soap_decode(), SOAP_STR_EOS, and soap::tmpbuf.

Referenced by soap_begin_recv(), and soap_resolve_attachment().

15217  {
15218  register size_t n;
15219 
15220  if (!s)
15221  return 1;
15222 
15223  if (!strcmp(s, t))
15224  return 0;
15225 
15226  if (!strncmp(s, "cid:", 4))
15227  s += 4;
15228 
15229  n = strlen(t);
15230 
15231  if (*t == '<')
15232  {
15233  t++;
15234  n -= 2;
15235  }
15236 
15237  if (!strncmp(s, t, n) && !s[n])
15238  return 0;
15239 
15240  soap_decode(soap->tmpbuf, sizeof(soap->tmpbuf), s, SOAP_STR_EOS);
15241 
15242  if (!strncmp(soap->tmpbuf, t, n) && !soap->tmpbuf[n])
15243  return 0;
15244 
15245  return 1;
15246  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
static const char * soap_decode(char *, size_t, const char *, const char *)
Definition: stdsoap2.cpp:17360
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
int soap_match_namespace ( struct soap ,
const char *  ,
const char *  ,
size_t  n1,
size_t  n2 
)

Definition at line 3585 of file stdsoap2.cpp.

References soap::error, Namespace::id, soap_nlist::id, soap_nlist::index, soap::local_namespaces, soap_nlist::next, soap::nlist, SOAP_NAMESPACE, SOAP_OK, and SOAP_SYNTAX_ERROR.

Referenced by soap_match_tag().

3586  {
3587  register struct soap_nlist *np = soap->nlist;
3588 
3589  while (np && (strncmp(np->id, id1, n1) || np->id[n1]))
3590  np = np->next;
3591 
3592  if (np)
3593  {
3594  if (np->index < 0
3595  || (soap->local_namespaces[np->index].id
3596  && (strncmp(soap->local_namespaces[np->index].id, id2, n2)
3597  || soap->local_namespaces[np->index].id[n2])))
3598  return SOAP_NAMESPACE;
3599 
3600  return SOAP_OK;
3601  }
3602 
3603  if (n1 == 3 && n1 == n2 && !strncmp(id1, "xml", 3) && !strncmp(id1, id2, 3))
3604  return SOAP_OK;
3605 
3606  return soap->error = SOAP_SYNTAX_ERROR;
3607  }
int error
Definition: stdsoap2.h:1755
char id[1]
Definition: stdsoap2.h:1275
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
short index
Definition: stdsoap2.h:1273
struct soap_nlist * next
Definition: stdsoap2.h:1271
#define SOAP_SYNTAX_ERROR
Definition: stdsoap2.h:1000
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_NAMESPACE
Definition: stdsoap2.h:1004
const char * id
Definition: stdsoap2.h:1262
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
int soap_match_tag ( struct soap ,
const char *  ,
const char *   
)

Definition at line 3727 of file stdsoap2.cpp.

References DBGLOG, soap_match_namespace(), SOAP_NAMESPACE, SOAP_OK, SOAP_STRCMP, and SOAP_TAG_MISMATCH.

Referenced by soap_attr_value(), soap_element_begin_in(), soap_element_end_in(), soap_getelement(), soap_ignore_element(), soap_inbyte(), soap_indateTime(), soap_inint(), soap_inlong(), soap_inLONG64(), soap_inshort(), soap_inULONG64(), soap_inunsignedByte(), soap_inunsignedInt(), soap_inunsignedLong(), soap_inunsignedShort(), soap_isnumeric(), soap_match_array(), soap_peek_element(), and soap_recv_fault().

3728  {
3729  register const char *s, *t;
3730  register int err;
3731 
3732  if (!tag1 || !tag2 || !*tag2)
3733  return SOAP_OK;
3734 
3735  s = strchr(tag1, ':');
3736  t = strchr(tag2, ':');
3737 
3738  if (t)
3739  {
3740  if (s)
3741  {
3742  if (t[1] && SOAP_STRCMP(s + 1, t + 1))
3743  return SOAP_TAG_MISMATCH;
3744 
3745  if (t != tag2 && (err = soap_match_namespace(soap, tag1, tag2, s - tag1, t - tag2)))
3746  {
3747  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2));
3748 
3749  if (err == SOAP_NAMESPACE)
3750  return SOAP_TAG_MISMATCH;
3751 
3752  return err;
3753  }
3754  }
3755  else if (SOAP_STRCMP(tag1, t + 1))
3756  {
3757  return SOAP_TAG_MISMATCH;
3758  }
3759  else if (t != tag2 && (err = soap_match_namespace(soap, tag1, tag2, 0, t - tag2)))
3760  {
3761  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2));
3762 
3763  if (err == SOAP_NAMESPACE)
3764  return SOAP_TAG_MISMATCH;
3765 
3766  return err;
3767  }
3768 
3769  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags and (default) namespaces match: '%s' '%s'\n", tag1, tag2));
3770  return SOAP_OK;
3771  }
3772 
3773  if (s)
3774  {
3775  if (SOAP_STRCMP(s + 1, tag2))
3776  return SOAP_TAG_MISMATCH;
3777  }
3778  else if (SOAP_STRCMP(tag1, tag2))
3779  return SOAP_TAG_MISMATCH;
3780 
3781  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags match: '%s' '%s'\n", tag1, tag2));
3782  return SOAP_OK;
3783  }
#define SOAP_STRCMP
Definition: stdsoap2.h:650
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int soap_match_namespace(struct soap *soap, const char *id1, const char *id2, size_t n1, size_t n2)
Definition: stdsoap2.cpp:3585
#define SOAP_TAG_MISMATCH
Definition: stdsoap2.h:998
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_NAMESPACE
Definition: stdsoap2.h:1004
int soap_move ( struct soap ,
long   
)

Definition at line 2051 of file stdsoap2.cpp.

References DBGLOG, SOAP_EOF, soap_getchar(), and SOAP_OK.

Referenced by soap_getdime(), soap_getdimefield(), and soap_getdimehdr().

2052  {
2053  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Moving %ld bytes forward\n", (long)n));
2054 
2055  for (; n > 0; n--)
2056  if ((int)soap_getchar(soap) == EOF)
2057  return SOAP_EOF;
2058 
2059  return SOAP_OK;
2060  }
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
soap_wchar soap_getchar(struct soap *soap)
Definition: stdsoap2.cpp:1616
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_EOF
Definition: stdsoap2.h:993
struct soap* soap_new ( void  )

Definition at line 6197 of file stdsoap2.cpp.

References SOAP_IO_DEFAULT, and soap_new2().

6198  {
6200  }
#define SOAP_IO_DEFAULT
Definition: stdsoap2.h:1127
struct soap * soap_new2(soap_mode imode, soap_mode omode)
Definition: stdsoap2.cpp:6208
struct soap* soap_new1 ( soap_mode  )

Definition at line 6186 of file stdsoap2.cpp.

References soap_new2().

6187  {
6188  return soap_new2(mode, mode);
6189  }
struct soap * soap_new2(soap_mode imode, soap_mode omode)
Definition: stdsoap2.cpp:6208
struct soap* soap_new2 ( soap_mode  ,
soap_mode   
)

Definition at line 6208 of file stdsoap2.cpp.

References soap_init2().

Referenced by soap_new(), and soap_new1().

6209  {
6210  struct soap *soap = (struct soap*)malloc(sizeof(struct soap));
6211 
6212  if (soap)
6213  soap_init2(soap, imode, omode);
6214 
6215  return soap;
6216  }
soap_mode imode
Definition: stdsoap2.h:1602
soap_mode omode
Definition: stdsoap2.h:1603
void soap_init2(struct soap *soap, soap_mode imode, soap_mode omode)
Definition: stdsoap2.cpp:8672
struct soap_blist* soap_new_block ( struct soap )

Definition at line 2728 of file stdsoap2.cpp.

References soap::blist, DBGLOG, soap::error, soap_blist::next, soap_blist::ptr, soap_blist::size, SOAP_EOM, and SOAP_MALLOC.

Referenced by soap_begin_send(), soap_get_http_body(), soap_get_mime_attachment(), soap_getbase64(), soap_getdime(), soap_gethex(), soap_in_ArrayOf_USCORExsd_USCOREstring(), soap_peek_element(), soap_string_in(), and soap_wstring_in().

2729  {
2730  struct soap_blist *p;
2731  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New block sequence (prev=%p)\n", soap->blist));
2732 
2733  if (!(p = (struct soap_blist*)SOAP_MALLOC(soap, sizeof(struct soap_blist))))
2734  {
2735  soap->error = SOAP_EOM;
2736  return NULL;
2737  }
2738 
2739  p->next = soap->blist;
2740  p->ptr = NULL;
2741  p->size = 0;
2742  soap->blist = p;
2743  return p;
2744  }
struct soap_blist * blist
Definition: stdsoap2.h:1624
int error
Definition: stdsoap2.h:1755
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
size_t size
Definition: stdsoap2.h:1283
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
#define SOAP_EOM
Definition: stdsoap2.h:1015
char * ptr
Definition: stdsoap2.h:1282
struct soap_blist * next
Definition: stdsoap2.h:1281
char* soap_next_block ( struct soap ,
struct soap_blist  
)

Definition at line 3092 of file stdsoap2.cpp.

References soap::blist, DBGLOG, soap_blist::ptr, and SOAP_FREE.

Referenced by soap_end_send(), and soap_save_block().

3093  {
3094  char *p;
3095 
3096  if (!b)
3097  b = soap->blist;
3098 
3099  p = b->ptr;
3100 
3101  if (p)
3102  {
3103  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Next block\n"));
3104  b->ptr = *(char**)p;
3105  SOAP_FREE(soap, p);
3106 
3107  if (b->ptr)
3108  return b->ptr + sizeof(char*) + sizeof(size_t);
3109  }
3110 
3111  return NULL;
3112  }
struct soap_blist * blist
Definition: stdsoap2.h:1624
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
char * ptr
Definition: stdsoap2.h:1282
struct soap_multipart* soap_next_multipart ( struct soap_multipart )

Definition at line 15568 of file stdsoap2.cpp.

References soap_multipart::next.

15569  {
15570  if (content)
15571  return content->next;
15572 
15573  return NULL;
15574  }
int soap_outbyte ( struct soap ,
const char *  tag,
int  id,
const char *  p,
const char *  ,
int   
)

Definition at line 12268 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_long2s(), and soap_string_out().

Referenced by soap_out_byte().

12269  {
12270  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
12271  || soap_string_out(soap, soap_long2s(soap, (long)*p), 0))
12272  return soap->error;
12273 
12274  return soap_element_end_out(soap, tag);
12275  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
const char * soap_long2s(struct soap *soap, long n)
Definition: stdsoap2.cpp:12047
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outdateTime ( struct soap ,
const char *  tag,
int  id,
const time_t *  p,
const char *  ,
int   
)

Definition at line 13885 of file stdsoap2.cpp.

References soap::error, soap_dateTime2s(), soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), and soap_string_out().

13886  {
13887  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
13889  return soap->error;
13890 
13891  return soap_element_end_out(soap, tag);
13892  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
const char * soap_dateTime2s(struct soap *soap, time_t n)
Definition: stdsoap2.cpp:13795
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outdouble ( struct soap ,
const char *  tag,
int  id,
const double *  p,
const char *  ,
int   
)

Definition at line 12648 of file stdsoap2.cpp.

References soap::error, soap_double2s(), soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), and soap_string_out().

12649  {
12650  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
12651  || soap_string_out(soap, soap_double2s(soap, *p), 0))
12652  return soap->error;
12653 
12654  return soap_element_end_out(soap, tag);
12655  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
const char * soap_double2s(struct soap *soap, double n)
Definition: stdsoap2.cpp:12615
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outfloat ( struct soap ,
const char *  tag,
int  id,
const float *  p,
const char *  ,
int   
)

Definition at line 12467 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_float2s(), and soap_string_out().

12468  {
12469  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
12470  || soap_string_out(soap, soap_float2s(soap, *p), 0))
12471  return soap->error;
12472 
12473  return soap_element_end_out(soap, tag);
12474  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
const char * soap_float2s(struct soap *soap, float n)
Definition: stdsoap2.cpp:12434
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outint ( struct soap ,
const char *  tag,
int  id,
const int *  p,
const char *  ,
int   
)

Definition at line 11960 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_long2s(), and soap_string_out().

Referenced by soap_out_int().

11961  {
11962  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
11963  || soap_string_out(soap, soap_long2s(soap, (long)*p), 0))
11964  return soap->error;
11965 
11966  return soap_element_end_out(soap, tag);
11967  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
const char * soap_long2s(struct soap *soap, long n)
Definition: stdsoap2.cpp:12047
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outliteral ( struct soap ,
const char *  tag,
char *const *  p,
const char *  type 
)

Definition at line 14028 of file stdsoap2.cpp.

References soap::error, Namespace::id, soap::local_namespaces, Namespace::ns, soap_attribute(), soap_element(), soap_element_begin_out(), soap_element_end_out(), soap_element_start_end_out(), SOAP_OK, soap_send(), SOAP_STR_EOS, and soap::tmpbuf.

Referenced by soap_out_SOAP_ENV__Detail().

14029  {
14030  int i;
14031  const char *t = NULL;
14032 
14033  if (tag && *tag != '-')
14034  {
14035  if (soap->local_namespaces && (t = strchr(tag, ':')))
14036  {
14037  strncpy(soap->tmpbuf, tag, t - tag);
14038  soap->tmpbuf[t - tag] = '\0';
14039 
14040  for (i = 0; soap->local_namespaces[i].id; i++)
14041  if (!strcmp(soap->tmpbuf, soap->local_namespaces[i].id))
14042  break;
14043 
14044  t++;
14045 
14046  if (soap_element(soap, t, 0, type)
14048  || soap_element_start_end_out(soap, NULL))
14049  return soap->error;
14050  }
14051  else
14052  {
14053  t = tag;
14054 
14055  if (soap_element_begin_out(soap, t, 0, type))
14056  return soap->error;
14057  }
14058  }
14059 
14060  if (p && *p)
14061  {
14062  if (soap_send(soap, *p))
14063  return soap->error;
14064  }
14065 
14066  if (t)
14067  return soap_element_end_out(soap, t);
14068 
14069  return SOAP_OK;
14070  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
int soap_element(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9009
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
int soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:959
int soap_element_start_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9458
const char * ns
Definition: stdsoap2.h:1263
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
const char * id
Definition: stdsoap2.h:1262
int soap_attribute(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:9802
int soap_outlong ( struct soap ,
const char *  tag,
int  id,
const long *  p,
const char *  ,
int   
)

Definition at line 12059 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_long2s(), and soap_string_out().

12060  {
12061  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
12062  || soap_string_out(soap, soap_long2s(soap, *p), 0))
12063  return soap->error;
12064 
12065  return soap_element_end_out(soap, tag);
12066  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
const char * soap_long2s(struct soap *soap, long n)
Definition: stdsoap2.cpp:12047
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outLONG64 ( struct soap ,
const char *  tag,
int  id,
const long long *  p,
const char *  ,
int   
)

Definition at line 12158 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_LONG642s(), and soap_string_out().

12159  {
12160  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
12161  || soap_string_out(soap, soap_LONG642s(soap, *p), 0))
12162  return soap->error;
12163 
12164  return soap_element_end_out(soap, tag);
12165  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
const char * soap_LONG642s(struct soap *soap, long long n)
Definition: stdsoap2.cpp:12146
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outshort ( struct soap ,
const char *  tag,
int  id,
const short *  p,
const char *  ,
int   
)

Definition at line 12356 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_long2s(), and soap_string_out().

12357  {
12358  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
12359  || soap_string_out(soap, soap_long2s(soap, (long)*p), 0))
12360  return soap->error;
12361 
12362  return soap_element_end_out(soap, tag);
12363  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
const char * soap_long2s(struct soap *soap, long n)
Definition: stdsoap2.cpp:12047
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outstring ( struct soap ,
const char *  tag,
int  id,
char *const *  p,
const char *  ,
int   
)

Definition at line 13601 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_C_NILSTRING, soap_element_begin_out(), soap_element_end_out(), soap_element_id(), soap_element_null(), SOAP_OK, and soap_string_out().

Referenced by soap_out__QName(), and soap_out_string().

13602  {
13603  id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n);
13604 
13605  if (id < 0)
13606  return soap->error;
13607 
13608  if (!**p && (soap->mode & SOAP_C_NILSTRING))
13609  return soap_element_null(soap, tag, id, type);
13610 
13611  if (soap_element_begin_out(soap, tag, id, type)
13612  || soap_string_out(soap, *p, 0)
13613  || soap_element_end_out(soap, tag))
13614  return soap->error;
13615 
13616  return SOAP_OK;
13617  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
soap_mode mode
Definition: stdsoap2.h:1601
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
int soap_element_null(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9686
int soap_element_id(struct soap *soap, const char *tag, int id, const void *p, const struct soap_array *a, int n, const char *type, int t)
Definition: stdsoap2.cpp:9717
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
#define SOAP_C_NILSTRING
Definition: stdsoap2.h:1119
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_outULONG64 ( struct soap ,
const char *  tag,
int  id,
const unsigned long long *  p,
const char *  ,
int   
)

Definition at line 13138 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_string_out(), and soap_ULONG642s().

13139  {
13140  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
13141  || soap_string_out(soap, soap_ULONG642s(soap, *p), 0))
13142  return soap->error;
13143 
13144  return soap_element_end_out(soap, tag);
13145  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
const char * soap_ULONG642s(struct soap *soap, unsigned long long n)
Definition: stdsoap2.cpp:13126
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outunsignedByte ( struct soap ,
const char *  tag,
int  id,
const unsigned char *  p,
const char *  ,
int   
)

Definition at line 12763 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_string_out(), and soap_unsignedLong2s().

12764  {
12765  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
12766  || soap_string_out(soap, soap_unsignedLong2s(soap, (unsigned long)*p), 0))
12767  return soap->error;
12768 
12769  return soap_element_end_out(soap, tag);
12770  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
const char * soap_unsignedLong2s(struct soap *soap, unsigned long n)
Definition: stdsoap2.cpp:13027
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outunsignedInt ( struct soap ,
const char *  tag,
int  id,
const unsigned int *  p,
const char *  ,
int   
)

Definition at line 12940 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_string_out(), and soap_unsignedLong2s().

12941  {
12942  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
12943  || soap_string_out(soap, soap_unsignedLong2s(soap, (unsigned long)*p), 0))
12944  return soap->error;
12945 
12946  return soap_element_end_out(soap, tag);
12947  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
const char * soap_unsignedLong2s(struct soap *soap, unsigned long n)
Definition: stdsoap2.cpp:13027
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outunsignedLong ( struct soap ,
const char *  tag,
int  id,
const unsigned long *  p,
const char *  ,
int   
)

Definition at line 13039 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_string_out(), and soap_unsignedLong2s().

13040  {
13041  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
13043  return soap->error;
13044 
13045  return soap_element_end_out(soap, tag);
13046  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
const char * soap_unsignedLong2s(struct soap *soap, unsigned long n)
Definition: stdsoap2.cpp:13027
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outunsignedShort ( struct soap ,
const char *  tag,
int  id,
const unsigned short *  p,
const char *  ,
int   
)

Definition at line 12851 of file stdsoap2.cpp.

References soap::error, soap_element_begin_out(), soap_element_end_out(), soap_embedded_id(), soap_string_out(), and soap_unsignedLong2s().

12852  {
12853  if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
12854  || soap_string_out(soap, soap_unsignedLong2s(soap, (unsigned long)*p), 0))
12855  return soap->error;
12856 
12857  return soap_element_end_out(soap, tag);
12858  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
int soap_string_out(struct soap *soap, const char *s, int flag)
Definition: stdsoap2.cpp:10882
const char * soap_unsignedLong2s(struct soap *soap, unsigned long n)
Definition: stdsoap2.cpp:13027
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
int soap_embedded_id(struct soap *soap, int id, const void *p, int t)
Definition: stdsoap2.cpp:6761
int soap_outwliteral ( struct soap ,
const char *  tag,
wchar_t *const *  p,
const char *  type 
)

Definition at line 14125 of file stdsoap2.cpp.

References soap::error, Namespace::id, soap::local_namespaces, Namespace::ns, soap_attribute(), soap_element(), soap_element_begin_out(), soap_element_end_out(), soap_element_start_end_out(), SOAP_OK, soap_pututf8(), soap_send(), SOAP_STR_EOS, and soap::tmpbuf.

14126  {
14127  int i;
14128  const char *t = NULL;
14129 
14130  if (tag && *tag != '-')
14131  {
14132  if (soap->local_namespaces && (t = strchr(tag, ':')))
14133  {
14134  strncpy(soap->tmpbuf, tag, t - tag);
14135  soap->tmpbuf[t - tag] = '\0';
14136 
14137  for (i = 0; soap->local_namespaces[i].id; i++)
14138  if (!strcmp(soap->tmpbuf, soap->local_namespaces[i].id))
14139  break;
14140 
14141  t++;
14142 
14143  if (soap_element(soap, t, 0, type)
14145  || soap_element_start_end_out(soap, NULL))
14146  return soap->error;
14147  }
14148  else
14149  {
14150  t = tag;
14151 
14152  if (soap_element_begin_out(soap, t, 0, type))
14153  return soap->error;
14154  }
14155 
14156  if (soap_send(soap, soap->tmpbuf))
14157  return soap->error;
14158  }
14159 
14160  if (p)
14161  {
14162  wchar_t c;
14163  const wchar_t *s = *p;
14164 
14165  while ((c = *s++))
14166  {
14167  if (soap_pututf8(soap, (unsigned long)c))
14168  return soap->error;
14169  }
14170  }
14171 
14172  if (t)
14173  return soap_element_end_out(soap, t);
14174 
14175  return SOAP_OK;
14176  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
int soap_element(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9009
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
int soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:959
int soap_pututf8(struct soap *soap, register unsigned long c)
Definition: stdsoap2.cpp:2082
int soap_element_start_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9458
const char * ns
Definition: stdsoap2.h:1263
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
const char * id
Definition: stdsoap2.h:1262
int soap_attribute(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:9802
int soap_outwstring ( struct soap ,
const char *  tag,
int  id,
wchar_t *const *  p,
const char *  ,
int   
)

Definition at line 13680 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_C_NILSTRING, soap_element_begin_out(), soap_element_end_out(), soap_element_id(), soap_element_null(), SOAP_OK, and soap_wstring_out().

13681  {
13682  id = soap_element_id(soap, tag, id, *p, NULL, 0, type, n);
13683 
13684  if (id < 0)
13685  return soap->error;
13686 
13687  if (!**p && (soap->mode & SOAP_C_NILSTRING))
13688  return soap_element_null(soap, tag, id, type);
13689 
13690  if (soap_element_begin_out(soap, tag, id, type)
13691  || soap_wstring_out(soap, *p, 0)
13692  || soap_element_end_out(soap, tag))
13693  return soap->error;
13694 
13695  return SOAP_OK;
13696  }
int error
Definition: stdsoap2.h:1755
int soap_element_end_out(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9588
soap_mode mode
Definition: stdsoap2.h:1601
int soap_wstring_out(struct soap *soap, const wchar_t *s, int flag)
Definition: stdsoap2.cpp:11642
int soap_element_null(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9686
int soap_element_id(struct soap *soap, const char *tag, int id, const void *p, const struct soap_array *a, int n, const char *type, int t)
Definition: stdsoap2.cpp:9717
int soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
Definition: stdsoap2.cpp:9244
#define SOAP_C_NILSTRING
Definition: stdsoap2.h:1119
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_peek_element ( struct soap )

Definition at line 10336 of file stdsoap2.cpp.

References soap::actor, soap::arrayOffset, soap::arraySize, soap::arrayType, soap::attributes, soap_dom_element::atts, soap::blist, soap::body, soap_dom_element::data, soap::dom, soap_dom_element::elts, soap::error, soap_dom_element::head, soap::href, soap::id, soap::labbuf, soap::labidx, soap::lablen, soap::mode, soap::mustUnderstand, soap_attribute::name, soap_dom_element::name, soap_attribute::next, soap_dom_attribute::next, soap_dom_element::next, soap_dom_element::node, soap_dom_element::nstr, soap::null, soap::other, soap::peeked, soap::position, soap::positions, soap_dom_element::prnt, soap::root, soap_blist::size, soap_attribute::size, soap_dom_attribute::soap, soap_dom_element::soap, SOAP_AP, soap_append_lab(), soap_blank, SOAP_BLKLEN, soap_current_namespace(), SOAP_ENC_DIME, SOAP_ENC_MTOM, SOAP_EOF, SOAP_EOM, SOAP_FREE, soap_get1, soap_getattrval(), soap_getposition(), soap_getutf8(), SOAP_LABLEN, SOAP_LT, SOAP_MALLOC, soap_malloc(), soap_match_tag(), soap_new_block(), SOAP_NO_TAG, soap_notblank, SOAP_OK, soap_pop_namespace(), soap_push_block(), soap_push_namespace(), SOAP_QT, soap_save_block(), soap_store_lab(), SOAP_STR_EOS, SOAP_STRCMP, soap_strdup(), soap_strrchr, SOAP_SYNTAX_ERROR, soap_unget, SOAP_XML_DOM, SOAP_XML_GRAPH, SOAP_XML_TREE, soap::tag, soap_dom_element::tail, soap::tmpbuf, soap_dom_element::type, soap::type, soap_attribute::value, soap::version, soap_attribute::visible, and soap_dom_element::wide.

Referenced by soap_element_begin_in(), soap_getelement(), soap_ignore_element(), soap_in_ArrayOf_USCORExsd_USCOREstring(), and soap_xop_forward().

10337  {
10338 #ifdef WITH_DOM
10339  register struct soap_dom_attribute **att = NULL;
10340  register char *lead = NULL;
10341 #endif
10342  register struct soap_attribute *tp, *tq = NULL;
10343  const char *t;
10344  register char *s;
10345  register soap_wchar c;
10346  register int i;
10347 
10348  if (soap->peeked)
10349  {
10350  if (!*soap->tag)
10351  return soap->error = SOAP_NO_TAG;
10352 
10353  return SOAP_OK;
10354  }
10355 
10356  soap->peeked = 1;
10357  soap->id[0] = '\0';
10358  soap->href[0] = '\0';
10359  soap->type[0] = '\0';
10360  soap->arrayType[0] = '\0';
10361  soap->arraySize[0] = '\0';
10362  soap->arrayOffset[0] = '\0';
10363  soap->other = 0;
10364  soap->root = -1;
10365  soap->position = 0;
10366  soap->null = 0;
10367  soap->mustUnderstand = 0;
10368  c = soap_getutf8(soap);
10369 #ifdef WITH_DOM
10370 
10371  /* whitespace leading to start tag is not insignificant for DOM */
10372  if (soap_blank(c))
10373  {
10374  soap->labidx = 0;
10375 
10376  do
10377  {
10378  if (soap_append_lab(soap, NULL, 0))
10379  return SOAP_EOM;
10380 
10381  s = soap->labbuf + soap->labidx;
10382  i = soap->lablen - soap->labidx;
10383  soap->labidx = soap->lablen;
10384 
10385  while (soap_blank(c) && i--)
10386  {
10387  *s++ = c;
10388  c = soap_getutf8(soap);
10389  }
10390  }
10391  while (soap_blank(c));
10392 
10393  *s = '\0';
10394  lead = soap_strdup(soap, soap->labbuf);
10395  }
10396 
10397 #else
10398 
10399  while (soap_blank(c))
10400  c = soap_getutf8(soap);
10401 
10402 #endif
10403 
10404  if (c != SOAP_LT)
10405  {
10406  *soap->tag = '\0';
10407 
10408  if ((int)c == EOF)
10409  return soap->error = SOAP_EOF;
10410 
10411  soap_unget(soap, c);
10412 #ifdef WITH_DOM
10413 
10414  /* whitespace leading to end tag is not insignificant for DOM */
10415  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
10416  soap->dom->tail = soap_strdup(soap, lead);
10417 
10418 #endif
10419  return soap->error = SOAP_NO_TAG;
10420  }
10421 
10422  s = soap->tag;
10423 
10424  do c = soap_get1(soap);
10425 
10426  while (soap_blank(c));
10427 
10428  i = sizeof(soap->tag);
10429 
10430  while (c != '>' && c != '/' && soap_notblank(c) && (int)c != EOF)
10431  {
10432  if (--i > 0)
10433  *s++ = (char)c;
10434 
10435  c = soap_get1(soap);
10436  }
10437 
10438  while (soap_blank(c))
10439  c = soap_get1(soap);
10440 
10441  *s = '\0';
10442 #ifdef WITH_DOM
10443 
10444  if (soap->mode & SOAP_XML_DOM)
10445  {
10446  register struct soap_dom_element *elt;
10447  elt = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element));
10448 
10449  if (!elt)
10450  return soap->error;
10451 
10452  elt->next = NULL;
10453  elt->nstr = NULL;
10454  elt->name = soap_strdup(soap, soap->tag);
10455  elt->prnt = soap->dom;
10456  elt->elts = NULL;
10457  elt->atts = NULL;
10458  elt->data = NULL;
10459  elt->wide = NULL;
10460  elt->type = 0;
10461  elt->node = NULL;
10462  elt->head = lead;
10463  elt->tail = NULL;
10464  elt->soap = soap;
10465 
10466  if (soap->dom)
10467  {
10468  struct soap_dom_element *p = soap->dom->elts;
10469 
10470  if (p)
10471  {
10472  while (p->next)
10473  p = p->next;
10474 
10475  p->next = elt;
10476  }
10477  else
10478  soap->dom->elts = elt;
10479  }
10480 
10481  soap->dom = elt;
10482  att = &elt->atts;
10483  }
10484 
10485 #endif
10487 
10488  for (tp = soap->attributes; tp; tp = tp->next)
10489  tp->visible = 0;
10490 
10491  while ((int)c != EOF && c != '>' && c != '/')
10492  {
10493  s = soap->tmpbuf;
10494  i = sizeof(soap->tmpbuf);
10495 
10496  while (c != '=' && c != '>' && c != '/' && soap_notblank(c) && (int)c != EOF)
10497  {
10498  if (--i > 0)
10499  *s++ = (char)c;
10500 
10501  c = soap_get1(soap);
10502  }
10503 
10504  *s = '\0';
10505 
10506  if (i == sizeof(soap->tmpbuf))
10507  return soap->error = SOAP_SYNTAX_ERROR;
10508 
10509 #ifdef WITH_DOM
10510 
10511  /* add attribute name to dom */
10512  if (att)
10513  {
10514  *att = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute));
10515 
10516  if (!*att)
10517  return soap->error;
10518 
10519  (*att)->next = NULL;
10520  (*att)->nstr = NULL;
10521  (*att)->name = soap_strdup(soap, soap->tmpbuf);
10522  (*att)->data = NULL;
10523  (*att)->wide = NULL;
10524  (*att)->soap = soap;
10525  }
10526 
10527 #endif
10528 
10529  if (!strncmp(soap->tmpbuf, "xmlns", 5))
10530  {
10531  if (soap->tmpbuf[5] == ':')
10532  t = soap->tmpbuf + 6;
10533  else if (soap->tmpbuf[5])
10534  t = NULL;
10535  else
10536  t = SOAP_STR_EOS;
10537  }
10538  else
10539  t = NULL;
10540 
10541  tq = NULL;
10542 
10543  for (tp = soap->attributes; tp; tq = tp, tp = tp->next)
10544  {
10545  if (!SOAP_STRCMP(tp->name, soap->tmpbuf))
10546  break;
10547  }
10548 
10549  if (!tp)
10550  {
10551  tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + strlen(soap->tmpbuf));
10552 
10553  if (!tp)
10554  return soap->error = SOAP_EOM;
10555 
10556  strcpy(tp->name, soap->tmpbuf);
10557  tp->value = NULL;
10558  tp->size = 0;
10559 
10560  /* if attribute name is qualified, append it to the end of the list */
10561  if (tq && strchr(soap->tmpbuf, ':'))
10562  {
10563  tq->next = tp;
10564  tp->next = NULL;
10565  }
10566  else
10567  {
10568  tp->next = soap->attributes;
10569  soap->attributes = tp;
10570  }
10571  }
10572 
10573  while (soap_blank(c))
10574  c = soap_get1(soap);
10575 
10576  if (c == '=')
10577  {
10578  do c = soap_getutf8(soap);
10579 
10580  while (soap_blank(c));
10581 
10582  if (c != SOAP_QT && c != SOAP_AP)
10583  {
10584  soap_unget(soap, c);
10585  c = ' '; /* blank delimiter */
10586  }
10587 
10588  if (soap_getattrval(soap, tp->value, tp->size, c))
10589  {
10590 #ifdef WITH_FAST
10591 
10592  if (soap->error != SOAP_EOM)
10593  return soap->error;
10594 
10595  soap->error = SOAP_OK;
10596 
10597  if (soap_store_lab(soap, tp->value, tp->size))
10598  return soap->error;
10599 
10600  if (tp->value)
10601  SOAP_FREE(soap, tp->value);
10602 
10603  for (;;)
10604  {
10606  {
10607  if (soap->error != SOAP_EOM)
10608  return soap->error;
10609 
10610  soap->error = SOAP_OK;
10611  soap->labidx = soap->lablen;
10612 
10613  if (soap_append_lab(soap, NULL, 0))
10614  return soap->error;
10615  }
10616  else
10617  break;
10618  }
10619 
10620  if (soap->labidx)
10621  tp->size = soap->lablen;
10622  else
10623  {
10624  tp->size = strlen(soap->labbuf) + 1;
10625 
10626  if (tp->size < SOAP_LABLEN)
10627  tp->size = SOAP_LABLEN;
10628  }
10629 
10630  if (!(tp->value = (char*)SOAP_MALLOC(soap, tp->size)))
10631  return soap->error = SOAP_EOM;
10632 
10633  strcpy(tp->value, soap->labbuf);
10634 #else
10635  size_t n;
10636 
10637  if (soap->error != SOAP_EOM)
10638  return soap->error;
10639 
10640  soap->error = SOAP_OK;
10641 
10642  if (soap_new_block(soap) == NULL)
10643  return soap->error;
10644 
10645  for (;;)
10646  {
10647  if (!(s = (char*)soap_push_block(soap, NULL, SOAP_BLKLEN)))
10648  return soap->error;
10649 
10650  if (soap_getattrval(soap, s, SOAP_BLKLEN, c))
10651  {
10652  if (soap->error != SOAP_EOM)
10653  return soap->error;
10654 
10655  soap->error = SOAP_OK;
10656  }
10657  else
10658  break;
10659  }
10660 
10661  n = tp->size + soap->blist->size;
10662 
10663  if (!(s = (char*)SOAP_MALLOC(soap, n)))
10664  return soap->error = SOAP_EOM;
10665 
10666  if (tp->value)
10667  {
10668  memcpy(s, tp->value, tp->size);
10669  SOAP_FREE(soap, tp->value);
10670  }
10671 
10672  soap_save_block(soap, NULL, s + tp->size, 0);
10673  tp->value = s;
10674  tp->size = n;
10675 #endif
10676  }
10677 
10678  do c = soap_get1(soap);
10679 
10680  while (soap_blank(c));
10681 
10682  tp->visible = 2; /* seen this attribute w/ value */
10683 #ifdef WITH_DOM
10684 
10685  if (att)
10686  (*att)->data = soap_strdup(soap, tp->value);
10687 
10688 #endif
10689  }
10690  else
10691  tp->visible = 1; /* seen this attribute w/o value */
10692 
10693 #ifdef WITH_DOM
10694 
10695  if (att)
10696  att = &(*att)->next;
10697 
10698 #endif
10699 
10700  if (t && tp->value)
10701  {
10702  if (soap_push_namespace(soap, t, tp->value))
10703  return soap->error;
10704  }
10705  }
10706 
10707 #ifdef WITH_DOM
10708 
10709  if (att)
10710  {
10712 
10713  for (att = &soap->dom->atts; *att; att = &(*att)->next)
10714  (*att)->nstr = soap_current_namespace(soap, (*att)->name);
10715  }
10716 
10717 #endif
10718 
10719  if ((int)c == EOF)
10720  return soap->error = SOAP_EOF;
10721 
10722  if (!(soap->body = (c != '/')))
10723  do c = soap_get1(soap);
10724 
10725  while (soap_blank(c));
10726 
10727 #ifdef WITH_DOM
10728 
10729  if (soap->mode & SOAP_XML_DOM)
10730  {
10731  if (!soap->body && soap->dom->prnt)
10732  soap->dom = soap->dom->prnt;
10733  }
10734 
10735 #endif
10736 
10737  for (tp = soap->attributes; tp; tp = tp->next)
10738  {
10739  if (tp->visible && tp->value)
10740  {
10741 #ifndef WITH_NOIDREF
10742 
10743  if (!strcmp(tp->name, "id"))
10744  {
10745  if ((soap->version > 0 && !(soap->mode & SOAP_XML_TREE))
10746  || (soap->mode & SOAP_XML_GRAPH))
10747  {
10748  *soap->id = '#';
10749  strncpy(soap->id + 1, tp->value, sizeof(soap->id) - 2);
10750  soap->id[sizeof(soap->id) - 1] = '\0';
10751  }
10752  }
10753  else if (!strcmp(tp->name, "href"))
10754  {
10755  if (soap->version == 1
10756  || (soap->mode & SOAP_XML_GRAPH)
10757  || (soap->mode & SOAP_ENC_MTOM)
10758  || (soap->mode & SOAP_ENC_DIME))
10759  {
10760  strncpy(soap->href, tp->value, sizeof(soap->href) - 1);
10761  soap->href[sizeof(soap->href) - 1] = '\0';
10762  }
10763  }
10764  else
10765 #endif
10766  if (!soap_match_tag(soap, tp->name, "xsi:type"))
10767  {
10768  strncpy(soap->type, tp->value, sizeof(soap->type) - 1);
10769  soap->type[sizeof(soap->type) - 1] = '\0';
10770  }
10771  else if ((!soap_match_tag(soap, tp->name, "xsi:null")
10772  || !soap_match_tag(soap, tp->name, "xsi:nil"))
10773  && (!strcmp(tp->value, "1")
10774  || !strcmp(tp->value, "true")))
10775  {
10776  soap->null = 1;
10777  }
10778  else if (soap->version == 1)
10779  {
10780  if (!soap_match_tag(soap, tp->name, "SOAP-ENC:arrayType"))
10781  {
10782  s = soap_strrchr(tp->value, '[');
10783 
10784  if (s && (size_t)(s - tp->value) < sizeof(soap->arrayType))
10785  {
10786  strncpy(soap->arrayType, tp->value, s - tp->value);
10787  soap->arrayType[s - tp->value] = '\0';
10788  strncpy(soap->arraySize, s, sizeof(soap->arraySize) - 1);
10789  }
10790  else
10791  strncpy(soap->arrayType, tp->value, sizeof(soap->arrayType) - 1);
10792 
10793  soap->arraySize[sizeof(soap->arrayType) - 1] = '\0';
10794  soap->arrayType[sizeof(soap->arrayType) - 1] = '\0';
10795  }
10796  else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:offset"))
10797  strncpy(soap->arrayOffset, tp->value, sizeof(soap->arrayOffset));
10798  else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:position"))
10800  else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:root"))
10801  soap->root = ((!strcmp(tp->value, "1") || !strcmp(tp->value, "true")));
10802  else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:mustUnderstand")
10803  && (!strcmp(tp->value, "1") || !strcmp(tp->value, "true")))
10804  soap->mustUnderstand = 1;
10805  else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:actor"))
10806  {
10807  if ((!soap->actor || strcmp(soap->actor, tp->value))
10808  && strcmp(tp->value, "http://schemas.xmlsoap.org/soap/actor/next"))
10809  soap->other = 1;
10810  }
10811  }
10812  else if (soap->version == 2)
10813  {
10814 #ifndef WITH_NOIDREF
10815 
10816  if (!strcmp(tp->name, "ref")
10817  || !soap_match_tag(soap, tp->name, "SOAP-ENC:ref"))
10818  {
10819  *soap->href = '#';
10820  strncpy(soap->href + 1, tp->value, sizeof(soap->href) - 2);
10821  soap->href[sizeof(soap->href) - 1] = '\0';
10822  }
10823  else
10824 #endif
10825  if (!soap_match_tag(soap, tp->name, "SOAP-ENC:itemType"))
10826  strncpy(soap->arrayType, tp->value, sizeof(soap->arrayType) - 1);
10827  else if (!soap_match_tag(soap, tp->name, "SOAP-ENC:arraySize"))
10828  strncpy(soap->arraySize, tp->value, sizeof(soap->arraySize) - 1);
10829  else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:mustUnderstand")
10830  && (!strcmp(tp->value, "1") || !strcmp(tp->value, "true")))
10831  soap->mustUnderstand = 1;
10832  else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:role"))
10833  {
10834  if ((!soap->actor || strcmp(soap->actor, tp->value))
10835  && strcmp(tp->value, "http://www.w3.org/2003/05/soap-envelope/role/next"))
10836  soap->other = 1;
10837  }
10838  }
10839  }
10840  }
10841 
10842  return soap->error = SOAP_OK;
10843  }
int soap_store_lab(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:10275
char tmpbuf[1024]
Definition: stdsoap2.h:1712
size_t lablen
Definition: stdsoap2.h:1708
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
struct soap_blist * blist
Definition: stdsoap2.h:1624
#define SOAP_LABLEN
Definition: stdsoap2.h:820
char tag[(1024)]
Definition: stdsoap2.h:1713
#define SOAP_XML_GRAPH
Definition: stdsoap2.h:1111
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
#define SOAP_STRCMP
Definition: stdsoap2.h:650
soap_mode mode
Definition: stdsoap2.h:1601
soap_wchar soap_getutf8(struct soap *soap)
Definition: stdsoap2.cpp:2143
#define SOAP_NO_TAG
Definition: stdsoap2.h:1001
int soap_getposition(const char *attr, int *pos)
Definition: stdsoap2.cpp:3452
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1101
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
short version
Definition: stdsoap2.h:1600
struct soap * soap
Definition: stdsoap2.h:1550
char href[(1024)]
Definition: stdsoap2.h:1715
struct soap_dom_element * prnt
Definition: stdsoap2.h:1539
struct soap_attribute * next
Definition: stdsoap2.h:1337
short peeked
Definition: stdsoap2.h:1731
const char * soap_current_namespace(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:3615
const char * actor
Definition: stdsoap2.h:1610
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
struct soap_blist * soap_new_block(struct soap *soap)
Definition: stdsoap2.cpp:2728
#define SOAP_XML_TREE
Definition: stdsoap2.h:1110
#define soap_blank(c)
Definition: stdsoap2.cpp:118
void soap_pop_namespace(struct soap *soap)
Definition: stdsoap2.cpp:3565
size_t size
Definition: stdsoap2.h:1283
char * soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
Definition: stdsoap2.cpp:3179
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
char id[(1024)]
Definition: stdsoap2.h:1714
struct soap_dom_element * next
Definition: stdsoap2.h:1538
#define SOAP_BLKLEN
Definition: stdsoap2.h:841
char arraySize[(1024)]
Definition: stdsoap2.h:1718
int soap_push_namespace(struct soap *soap, const char *id, const char *ns)
Definition: stdsoap2.cpp:3483
size_t labidx
Definition: stdsoap2.h:1709
#define SOAP_QT
Definition: stdsoap2.cpp:115
char * labbuf
Definition: stdsoap2.h:1707
struct soap_dom_attribute * next
Definition: stdsoap2.h:1493
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
char name[1]
Definition: stdsoap2.h:1342
#define SOAP_SYNTAX_ERROR
Definition: stdsoap2.h:1000
short mustUnderstand
Definition: stdsoap2.h:1726
#define SOAP_AP
Definition: stdsoap2.cpp:116
int soap_append_lab(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:10289
#define SOAP_OK
Definition: stdsoap2.h:995
int positions[(16)]
Definition: stdsoap2.h:1722
#define soap_strrchr(s, t)
Definition: stdsoap2.h:1913
char type[(1024)]
Definition: stdsoap2.h:1716
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
void * soap_push_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:2752
#define soap_get1(soap)
Definition: stdsoap2.h:1893
char arrayOffset[(1024)]
Definition: stdsoap2.h:1719
short position
Definition: stdsoap2.h:1721
#define SOAP_EOM
Definition: stdsoap2.h:1015
struct soap_dom_attribute * atts
Definition: stdsoap2.h:1541
char arrayType[(1024)]
Definition: stdsoap2.h:1717
struct soap_dom_element * elts
Definition: stdsoap2.h:1540
#define SOAP_EOF
Definition: stdsoap2.h:993
wchar_t * wide
Definition: stdsoap2.h:1545
#define soap_notblank(c)
Definition: stdsoap2.cpp:119
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
short body
Definition: stdsoap2.h:1703
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
#define SOAP_LT
Definition: stdsoap2.cpp:112
short root
Definition: stdsoap2.h:1723
short null
Definition: stdsoap2.h:1727
int32_t soap_wchar
Definition: stdsoap2.h:1257
short other
Definition: stdsoap2.h:1720
const char * nstr
Definition: stdsoap2.h:1542
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
char * value
Definition: stdsoap2.h:1338
struct soap * soap
Definition: stdsoap2.h:1498
static int soap_getattrval(struct soap *, char *, size_t, soap_wchar)
Definition: stdsoap2.cpp:10195
int soap_pointer_enter ( struct soap ,
const void p,
const struct soap_array a,
int  n,
int  t,
struct soap_plist **   
)

Definition at line 6336 of file stdsoap2.cpp.

References soap_array::__ptr, soap_array::__size, soap_plist::array, DBGLOG, soap::error, soap_plist::id, soap::idnum, soap_plist::mark1, soap_plist::mark2, soap_plist::next, soap_pblk::next, soap::pblk, soap::pht, soap::pidx, soap_pblk::plist, soap_plist::ptr, SOAP_EOM, soap_hash_ptr, SOAP_MALLOC, SOAP_PTRBLK, and soap_plist::type.

Referenced by soap_array_reference(), soap_attachment(), and soap_reference().

6337  {
6338  register size_t h;
6339  register struct soap_plist *pp;
6340 
6341  if (!soap->pblk || soap->pidx >= SOAP_PTRBLK)
6342  {
6343  register struct soap_pblk *pb = (struct soap_pblk*)SOAP_MALLOC(soap, sizeof(struct soap_pblk));
6344 
6345  if (!pb)
6346  {
6347  soap->error = SOAP_EOM;
6348  return 0;
6349  }
6350 
6351  pb->next = soap->pblk;
6352  soap->pblk = pb;
6353  soap->pidx = 0;
6354  }
6355 
6356  *ppp = pp = &soap->pblk->plist[soap->pidx++];
6357 
6358  if (a)
6359  h = soap_hash_ptr(a->__ptr);
6360  else
6361  h = soap_hash_ptr(p);
6362 
6363  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pointer enter location=%p array=%p size=%d dim=%d type=%d id=%d\n", p, a ? a->__ptr : NULL, a ? a->__size : 0, n, type, soap->idnum + 1));
6364  pp->next = soap->pht[h];
6365  pp->type = type;
6366  pp->mark1 = 0;
6367  pp->mark2 = 0;
6368  pp->ptr = p;
6369  pp->array = a;
6370  soap->pht[h] = pp;
6371  pp->id = ++soap->idnum;
6372  return pp->id;
6373  }
int error
Definition: stdsoap2.h:1755
struct soap_plist * next
Definition: stdsoap2.h:1296
#define SOAP_PTRBLK
Definition: stdsoap2.h:823
const struct soap_array * array
Definition: stdsoap2.h:1298
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char mark1
Definition: stdsoap2.h:1301
short pidx
Definition: stdsoap2.h:1630
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
struct soap_pblk * next
Definition: stdsoap2.h:1308
int __size
Definition: stdsoap2.h:1290
const void * ptr
Definition: stdsoap2.h:1297
struct soap_plist * pht[(1024)]
Definition: stdsoap2.h:1628
struct soap_pblk * pblk
Definition: stdsoap2.h:1629
int idnum
Definition: stdsoap2.h:1633
#define soap_hash_ptr(p)
Definition: stdsoap2.cpp:124
struct soap_plist plist[(32)]
Definition: stdsoap2.h:1309
#define SOAP_EOM
Definition: stdsoap2.h:1015
void * __ptr
Definition: stdsoap2.h:1289
char mark2
Definition: stdsoap2.h:1302
int soap_pointer_lookup ( struct soap ,
const void p,
int  t,
struct soap_plist **   
)

Definition at line 6306 of file stdsoap2.cpp.

References DBGLOG, soap_plist::id, soap_plist::next, soap::pht, soap_plist::ptr, soap_hash_ptr, and soap_plist::type.

Referenced by soap_element_id(), soap_embed(), soap_embedded(), soap_embedded_id(), and soap_reference().

6307  {
6308  register struct soap_plist *pp;
6309  *ppp = NULL;
6310 
6311  if (p)
6312  {
6313  for (pp = soap->pht[soap_hash_ptr(p)]; pp; pp = pp->next)
6314  {
6315  if (pp->ptr == p && pp->type == type)
6316  {
6317  *ppp = pp;
6318  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup location=%p type=%d id=%d\n", p, type, pp->id));
6319  return pp->id;
6320  }
6321  }
6322  }
6323 
6324  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup location=%p type=%d: not found\n", p, type));
6325  return 0;
6326  }
struct soap_plist * next
Definition: stdsoap2.h:1296
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
const void * ptr
Definition: stdsoap2.h:1297
struct soap_plist * pht[(1024)]
Definition: stdsoap2.h:1628
#define soap_hash_ptr(p)
Definition: stdsoap2.cpp:124
int soap_pointer_lookup_id ( struct soap ,
void p,
int  t,
struct soap_plist **   
)
int soap_poll ( struct soap )

Definition at line 5673 of file stdsoap2.cpp.

References DBGLOG, soap::errnum, soap::error, soap::imode, soap::master, SOAP_EINTR, SOAP_ENC_SSL, SOAP_EOF, SOAP_FD_EXCEEDED, SOAP_OK, soap_set_receiver_error(), soap_socket_errno, SOAP_TCP_ERROR, soap_valid_socket, soap::socket, soap::ssl, tcp_error(), and soap::tmpbuf.

Referenced by soap_done(), and soap_init().

5674  {
5675 #ifndef WITH_LEAN
5676  struct timeval timeout;
5677  fd_set rfd, sfd, xfd;
5678  register int r;
5679 #ifndef WIN32
5680 
5681  if ((int)soap->socket >= (int)FD_SETSIZE)
5682  return SOAP_FD_EXCEEDED; /* Hint: MUST increase FD_SETSIZE */
5683 
5684 #endif
5685  timeout.tv_sec = 0;
5686  timeout.tv_usec = 0;
5687  FD_ZERO(&rfd);
5688  FD_ZERO(&sfd);
5689  FD_ZERO(&xfd);
5690 
5692  {
5693  FD_SET(soap->socket, &rfd);
5694  FD_SET(soap->socket, &sfd);
5695  FD_SET(soap->socket, &xfd);
5696  r = select((int)soap->socket + 1, &rfd, &sfd, &xfd, &timeout);
5697 
5698  if (r > 0 && FD_ISSET(soap->socket, &xfd))
5699  r = -1;
5700  }
5701  else if (soap_valid_socket(soap->master))
5702  {
5703  FD_SET(soap->master, &sfd);
5704  r = select((int)soap->master + 1, NULL, &sfd, NULL, &timeout);
5705  }
5706  else
5707  return SOAP_OK;
5708 
5709  if (r > 0)
5710  {
5711 #ifdef WITH_OPENSSL
5712 
5713  if (soap->imode & SOAP_ENC_SSL)
5714  {
5716  && FD_ISSET(soap->socket, &sfd)
5717  && (!FD_ISSET(soap->socket, &rfd)
5718  || SSL_peek(soap->ssl, soap->tmpbuf, 1) > 0))
5719  return SOAP_OK;
5720  }
5721  else
5722 #endif
5724  && FD_ISSET(soap->socket, &sfd)
5725  && (!FD_ISSET(soap->socket, &rfd)
5726  || recv(soap->socket, soap->tmpbuf, 1, MSG_PEEK) > 0))
5727  return SOAP_OK;
5728  }
5729  else if (r < 0)
5730  {
5732 
5734  {
5735  soap_set_receiver_error(soap, tcp_error(soap), "select failed in soap_poll()", SOAP_TCP_ERROR);
5736  return soap->error = SOAP_TCP_ERROR;
5737  }
5738  }
5739  else
5740  soap->errnum = 0;
5741 
5742  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Polling: other end down on socket=%d select=%d\n", soap->socket, r));
5743  return SOAP_EOF;
5744 #else
5745  return SOAP_OK;
5746 #endif
5747  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
#define soap_socket_errno(s)
Definition: stdsoap2.h:803
int error
Definition: stdsoap2.h:1755
#define soap_valid_socket(n)
Definition: stdsoap2.h:698
soap_mode imode
Definition: stdsoap2.h:1602
#define FD_SETSIZE
Definition: stdsoap2.h:705
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int soap_set_receiver_error(struct soap *soap, const char *faultstring, const char *faultdetailXML, int soaperror)
Definition: stdsoap2.cpp:19218
int master
Definition: stdsoap2.h:1683
void * ssl
Definition: stdsoap2.h:1799
static const char * tcp_error(struct soap *)
Definition: stdsoap2.cpp:4506
int errnum
Definition: stdsoap2.h:1757
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_TCP_ERROR
Definition: stdsoap2.h:1023
#define SOAP_EOF
Definition: stdsoap2.h:993
int socket
Definition: stdsoap2.h:1684
#define SOAP_FD_EXCEEDED
Definition: stdsoap2.h:1041
#define SOAP_ENC_SSL
Definition: stdsoap2.h:1103
#define SOAP_EINTR
Definition: stdsoap2.h:778
void soap_pop_block ( struct soap ,
struct soap_blist  
)

Definition at line 2780 of file stdsoap2.cpp.

References soap::blist, DBGLOG, soap_blist::ptr, soap_blist::size, and SOAP_FREE.

Referenced by soap_in_ArrayOf_USCORExsd_USCOREstring().

2781  {
2782  char *p;
2783 
2784  if (!b)
2785  b = soap->blist;
2786 
2787  if (!b->ptr)
2788  return;
2789 
2790  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop block\n"));
2791  p = b->ptr;
2792  b->size -= *(size_t*)(p + sizeof(char*));
2793  b->ptr = *(char**)p;
2794  SOAP_FREE(soap, p);
2795  }
struct soap_blist * blist
Definition: stdsoap2.h:1624
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
void soap_pop_namespace ( struct soap )

Definition at line 3565 of file stdsoap2.cpp.

References DBGLOG, soap_nlist::id, soap_nlist::level, soap::level, soap_nlist::next, soap::nlist, and SOAP_FREE.

Referenced by soap_element_end_in(), soap_peek_element(), and soap_pop_ns().

3566  {
3567  register struct soap_nlist *np, *nq;
3568 
3569  for (np = soap->nlist; np && np->level >= soap->level; np = nq)
3570  {
3571  nq = np->next;
3572  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop namespace binding (level=%u) '%s'\n", soap->level, np->id));
3573  SOAP_FREE(soap, np);
3574  }
3575 
3576  soap->nlist = np;
3577  }
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char id[1]
Definition: stdsoap2.h:1275
unsigned int level
Definition: stdsoap2.h:1272
struct soap_nlist * next
Definition: stdsoap2.h:1271
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
void soap_post_check_mime_attachments ( struct soap soap)

Definition at line 15025 of file stdsoap2.cpp.

References soap::imode, and SOAP_MIME_POSTCHECK.

15026  {
15027  soap->imode |= SOAP_MIME_POSTCHECK;
15028  }
soap_mode imode
Definition: stdsoap2.h:1602
#define SOAP_MIME_POSTCHECK
Definition: stdsoap2.h:1125
void soap_print_fault ( struct soap ,
FILE *   
)

Definition at line 19294 of file stdsoap2.cpp.

References soap::error, soap_check_state, soap_faultcode(), soap_faultdetail(), soap_faultstring(), soap_faultsubcode(), soap_set_fault(), and soap::version.

19295  {
19296  if (soap_check_state(soap))
19297  fprintf(fd, "Error: soap struct state not initialized\n");
19298  else if (soap->error)
19299  {
19300  const char *c, *v = NULL, *s, **d;
19301  d = soap_faultcode(soap);
19302 
19303  if (!*d)
19305 
19306  c = *d;
19307 
19308  if (soap->version == 2)
19309  v = *soap_faultsubcode(soap);
19310 
19311  s = *soap_faultstring(soap);
19312  d = soap_faultdetail(soap);
19313  fprintf(fd, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, c, v ? v : "no subcode", s ? s : "[no reason]", d && *d ? *d : "[no detail]");
19314  }
19315  }
int error
Definition: stdsoap2.h:1755
void soap_set_fault(struct soap *soap)
Definition: stdsoap2.cpp:18724
short version
Definition: stdsoap2.h:1600
const char ** soap_faultsubcode(struct soap *soap)
Definition: soapC.cpp:121
const char ** soap_faultdetail(struct soap *soap)
Definition: soapC.cpp:149
const char ** soap_faultstring(struct soap *soap)
Definition: soapC.cpp:139
const char ** soap_faultcode(struct soap *soap)
Definition: soapC.cpp:111
#define soap_check_state(soap)
Definition: stdsoap2.h:1150
void soap_print_fault_location ( struct soap ,
FILE *   
)

Definition at line 19404 of file stdsoap2.cpp.

References soap::buf, soap::bufidx, soap::buflen, soap::error, if(), and SOAP_BUFLEN.

19405  {
19406 #ifndef WITH_LEAN
19407  int i, j, c1, c2;
19408 
19409  if (soap->error && soap->bufidx <= soap->buflen && soap->buflen > 0 && soap->buflen <= SOAP_BUFLEN)
19410  {
19411  i = (int)soap->bufidx - 1;
19412 
19413  if (i <= 0)
19414  i = 0;
19415 
19416  c1 = soap->buf[i];
19417  soap->buf[i] = '\0';
19418 
19419  if ((int)soap->buflen >= i + 1024)
19420  j = i + 1023;
19421  else
19422  j = (int)soap->buflen - 1;
19423 
19424  c2 = soap->buf[j];
19425  soap->buf[j] = '\0';
19426  fprintf(fd, "%s%c\n<!-- ** HERE ** -->\n", soap->buf, c1);
19427 
19428  if (soap->bufidx < soap->buflen)
19429  fprintf(fd, "%s\n", soap->buf + soap->bufidx);
19430 
19431  soap->buf[i] = c1;
19432  soap->buf[j] = c2;
19433  }
19434 
19435 #endif
19436  }
int error
Definition: stdsoap2.h:1755
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
char buf[(65536)]
Definition: stdsoap2.h:1710
size_t bufidx
Definition: stdsoap2.h:1699
if(!yymsg) yymsg
size_t buflen
Definition: stdsoap2.h:1700
void* soap_push_block ( struct soap ,
struct soap_blist ,
size_t   
)

Definition at line 2752 of file stdsoap2.cpp.

References soap::blist, DBGLOG, soap::error, soap_blist::ptr, soap_blist::size, SOAP_EOM, and SOAP_MALLOC.

Referenced by soap_flush_raw(), soap_get_http_body(), soap_get_mime_attachment(), soap_getbase64(), soap_getdime(), soap_gethex(), soap_in_ArrayOf_USCORExsd_USCOREstring(), soap_peek_element(), soap_string_in(), and soap_wstring_in().

2753  {
2754  char *p;
2755 
2756  if (!b)
2757  b = soap->blist;
2758 
2759  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push block of %u bytes (%u bytes total)\n", (unsigned int)n, (unsigned int)b->size + (unsigned int)n));
2760 
2761  if (!(p = (char*)SOAP_MALLOC(soap, n + sizeof(char*) + sizeof(size_t))))
2762  {
2763  soap->error = SOAP_EOM;
2764  return NULL;
2765  }
2766 
2767  *(char**)p = b->ptr;
2768  *(size_t*)(p + sizeof(char*)) = n;
2769  b->ptr = p;
2770  b->size += n;
2771  return p + sizeof(char*) + sizeof(size_t);
2772  }
struct soap_blist * blist
Definition: stdsoap2.h:1624
int error
Definition: stdsoap2.h:1755
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
#define SOAP_EOM
Definition: stdsoap2.h:1015
int soap_push_namespace ( struct soap ,
const char *  ,
const char *   
)

Definition at line 3483 of file stdsoap2.cpp.

References DBGLOG, soap::error, Namespace::id, soap_nlist::id, Namespace::in, soap_nlist::index, soap_nlist::level, soap::level, soap::local_namespaces, soap_nlist::next, soap::nlist, Namespace::ns, soap_nlist::ns, Namespace::out, SOAP_EOM, SOAP_FREE, SOAP_MALLOC, SOAP_OK, and soap_tag_cmp().

Referenced by soap_peek_element(), and soap_set_namespaces().

3484  {
3485  register struct soap_nlist *np;
3486  register struct Namespace *p;
3487  register short i = -1;
3488  register size_t n, k;
3489  n = strlen(id);
3490  k = strlen(ns) + 1;
3491  p = soap->local_namespaces;
3492 
3493  if (p)
3494  {
3495  for (i = 0; p->id; p++, i++)
3496  {
3497  if (p->ns && !strcmp(ns, p->ns))
3498  {
3499  if (p->out)
3500  {
3501  SOAP_FREE(soap, p->out);
3502  p->out = NULL;
3503  }
3504 
3505  break;
3506  }
3507 
3508  if (p->out)
3509  {
3510  if (!strcmp(ns, p->out))
3511  break;
3512  }
3513  else if (p->in)
3514  {
3515  if (!soap_tag_cmp(ns, p->in))
3516  {
3517  if ((p->out = (char*)SOAP_MALLOC(soap, k)))
3518  strcpy(p->out, ns);
3519 
3520  break;
3521  }
3522  }
3523  }
3524 
3525  if (!p || !p->id)
3526  i = -1;
3527  }
3528 
3529  if (i >= 0)
3530  k = 0;
3531 
3532  np = (struct soap_nlist*)SOAP_MALLOC(soap, sizeof(struct soap_nlist) + n + k);
3533 
3534  if (!np)
3535  return soap->error = SOAP_EOM;
3536 
3537  np->next = soap->nlist;
3538  soap->nlist = np;
3539  np->level = soap->level;
3540  np->index = i;
3541  strcpy(np->id, id);
3542  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push namespace binding (level=%u) '%s' '%s'\n", soap->level, id, ns));
3543 
3544  if (i < 0)
3545  {
3546  np->ns = np->id + n + 1;
3547  strcpy(np->ns, ns);
3548  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push NOT OK: no match found for '%s' in namespace mapping table (added to stack anyway)\n", ns));
3549  }
3550  else
3551  {
3552  np->ns = NULL;
3553  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push OK ('%s' matches '%s' in namespace table)\n", id, p->id));
3554  }
3555 
3556  return SOAP_OK;
3557  }
const char * in
Definition: stdsoap2.h:1264
int error
Definition: stdsoap2.h:1755
int soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:3657
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char id[1]
Definition: stdsoap2.h:1275
char * ns
Definition: stdsoap2.h:1274
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
char * out
Definition: stdsoap2.h:1265
short index
Definition: stdsoap2.h:1273
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
const char * ns
Definition: stdsoap2.h:1263
unsigned int level
Definition: stdsoap2.h:1272
struct soap_nlist * next
Definition: stdsoap2.h:1271
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_EOM
Definition: stdsoap2.h:1015
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
const char * id
Definition: stdsoap2.h:1262
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
int soap_putbase64 ( struct soap ,
const unsigned char *  ,
int   
)

Definition at line 2361 of file stdsoap2.cpp.

References soap_dom_element::data, soap::dom, soap::error, soap::mode, SOAP_OK, soap_s2base64(), soap_send_raw(), and SOAP_XML_DOM.

2362  {
2363  register int i;
2364  register unsigned long m;
2365  char d[4];
2366 
2367  if (!s)
2368  return SOAP_OK;
2369 
2370 #ifdef WITH_DOM
2371 
2372  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
2373  {
2374  if (!(soap->dom->data = soap_s2base64(soap, s, NULL, n)))
2375  return soap->error;
2376 
2377  return SOAP_OK;
2378  }
2379 
2380 #endif
2381 
2382  for (; n > 2; n -= 3, s += 3)
2383  {
2384  m = s[0];
2385  m = (m << 8) | s[1];
2386  m = (m << 8) | s[2];
2387 
2388  for (i = 4; i > 0; m >>= 6)
2389  d[--i] = soap_base64o[m & 0x3F];
2390 
2391  if (soap_send_raw(soap, d, 4))
2392  return soap->error;
2393  }
2394 
2395  if (n > 0)
2396  {
2397  m = 0;
2398 
2399  for (i = 0; i < n; i++)
2400  m = (m << 8) | *s++;
2401 
2402  for (; i < 3; i++)
2403  m <<= 8;
2404 
2405  for (i++; i > 0; m >>= 6)
2406  d[--i] = soap_base64o[m & 0x3F];
2407 
2408  for (i = 3; i > n; i--)
2409  d[i] = '=';
2410 
2411  if (soap_send_raw(soap, d, 4))
2412  return soap->error;
2413  }
2414 
2415  return SOAP_OK;
2416  }
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define SOAP_OK
Definition: stdsoap2.h:995
char * soap_s2base64(struct soap *soap, const unsigned char *s, char *t, int n)
Definition: stdsoap2.cpp:17979
static const char soap_base64o[65]
Definition: stdsoap2.cpp:293
int soap_putdime ( struct soap )

Definition at line 14522 of file stdsoap2.cpp.

References DBGLOG, soap::dime, soap::error, soap::fdimeread, soap::fdimereadclose, soap::fdimereadopen, soap_dime::first, soap_dime::flags, soap_dime::id, soap_multipart::id, if(), soap::mode, soap_multipart::next, soap_dime::options, soap_multipart::options, soap_multipart::ptr, soap_dime::size, soap_multipart::size, SOAP_DIME_CF, SOAP_DIME_MB, SOAP_DIME_ME, SOAP_DIME_MEDIA, SOAP_DIME_VERSION, SOAP_ENC_DIME, SOAP_ENC_XML, SOAP_EOF, SOAP_IO, SOAP_IO_CHUNK, SOAP_IO_STORE, SOAP_OK, soap_putdimefield(), soap_putdimehdr(), soap_send_raw(), SOAP_STR_PADDING, soap::tmpbuf, soap_dime::type, and soap_multipart::type.

Referenced by soap_end_send().

14523  {
14524  struct soap_multipart *content;
14525 
14526  if (!(soap->mode & SOAP_ENC_DIME))
14527  return SOAP_OK;
14528 
14529  for (content = soap->dime.first; content; content = content->next)
14530  {
14531  void * handle;
14532  soap->dime.size = content->size;
14533  soap->dime.id = content->id;
14534  soap->dime.type = content->type;
14535  soap->dime.options = content->options;
14537 
14538  if (soap->fdimereadopen && ((handle = soap->fdimereadopen(soap, (void*)content->ptr, content->id, content->type, content->options)) || soap->error))
14539  {
14540  size_t size = content->size;
14541 
14542  if (!handle)
14543  {
14544  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadopen failed\n"));
14545  return soap->error;
14546  }
14547 
14548  if (!size && ((soap->mode & SOAP_ENC_XML) || (soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_IO) == SOAP_IO_STORE))
14549  {
14550  size_t chunksize = sizeof(soap->tmpbuf);
14551  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked streaming DIME\n"));
14552 
14553  do
14554  {
14555  size = soap->fdimeread(soap, handle, soap->tmpbuf, chunksize);
14556  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread returned %lu bytes\n", (unsigned long)size));
14557 
14558  if (size < chunksize)
14559  {
14560  soap->dime.flags &= ~SOAP_DIME_CF;
14561 
14562  if (!content->next)
14564  }
14565  else
14567 
14568  soap->dime.size = size;
14569 
14570  if (soap_putdimehdr(soap)
14571  || soap_putdimefield(soap, soap->tmpbuf, size))
14572  break;
14573 
14574  if (soap->dime.id)
14575  {
14577  soap->dime.id = NULL;
14578  soap->dime.type = NULL;
14579  soap->dime.options = NULL;
14580  }
14581  }
14582  while (size >= chunksize);
14583  }
14584  else
14585  {
14586  if (!content->next)
14588 
14589  if (soap_putdimehdr(soap))
14590  return soap->error;
14591 
14592  do
14593  {
14594  size_t bufsize;
14595 
14596  if (size < sizeof(soap->tmpbuf))
14597  bufsize = size;
14598  else
14599  bufsize = sizeof(soap->tmpbuf);
14600 
14601  if (!(bufsize = soap->fdimeread(soap, handle, soap->tmpbuf, bufsize)))
14602  {
14603  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)content->size));
14604  soap->error = SOAP_EOF;
14605  break;
14606  }
14607 
14608  if (soap_send_raw(soap, soap->tmpbuf, bufsize))
14609  break;
14610 
14611  size -= bufsize;
14612  }
14613  while (size);
14614 
14615  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n"));
14617  }
14618 
14619  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n"));
14620 
14621  if (soap->fdimereadclose)
14622  soap->fdimereadclose(soap, handle);
14623  }
14624  else
14625  {
14626  if (!content->next)
14628 
14629  if (soap_putdimehdr(soap)
14630  || soap_putdimefield(soap, (char*)content->ptr, content->size))
14631  return soap->error;
14632  }
14633  }
14634 
14635  return SOAP_OK;
14636  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
const char * id
Definition: stdsoap2.h:1444
void *(* fdimereadopen)(struct soap *, void *, const char *, const char *, const char *)
Definition: stdsoap2.h:1670
#define SOAP_STR_PADDING
Definition: stdsoap2.cpp:309
int error
Definition: stdsoap2.h:1755
#define SOAP_DIME_MEDIA
Definition: stdsoap2.h:1072
soap_mode mode
Definition: stdsoap2.h:1601
struct soap_multipart * first
Definition: stdsoap2.h:1397
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
size_t size
Definition: stdsoap2.h:1388
#define SOAP_IO
Definition: stdsoap2.h:1086
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_dime dime
Definition: stdsoap2.h:1760
size_t(* fdimeread)(struct soap *, void *, char *, size_t)
Definition: stdsoap2.h:1674
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
int soap_putdimehdr(struct soap *soap)
Definition: stdsoap2.cpp:14467
const char * options
Definition: stdsoap2.h:1395
#define SOAP_DIME_VERSION
Definition: stdsoap2.h:1071
const char * type
Definition: stdsoap2.h:1394
struct soap_multipart * next
Definition: stdsoap2.h:1441
#define SOAP_DIME_CF
Definition: stdsoap2.h:1068
static int soap_putdimefield(struct soap *, const char *, size_t)
Definition: stdsoap2.cpp:14420
#define SOAP_OK
Definition: stdsoap2.h:995
void(* fdimereadclose)(struct soap *, void *)
Definition: stdsoap2.h:1672
#define SOAP_IO_STORE
Definition: stdsoap2.h:1089
const char * id
Definition: stdsoap2.h:1393
char flags
Definition: stdsoap2.h:1391
const char * options
Definition: stdsoap2.h:1446
#define SOAP_ENC_XML
Definition: stdsoap2.h:1098
#define SOAP_EOF
Definition: stdsoap2.h:993
if(!yymsg) yymsg
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
const char * type
Definition: stdsoap2.h:1445
#define SOAP_DIME_MB
Definition: stdsoap2.h:1070
#define SOAP_DIME_ME
Definition: stdsoap2.h:1069
int soap_putdimehdr ( struct soap )

Definition at line 14467 of file stdsoap2.cpp.

References DBGLOG, soap::dime, soap::error, soap_dime::flags, soap_dime::id, soap_dime::options, soap_dime::size, SOAP_DIME_VERSION, SOAP_OK, soap_putdimefield(), soap_send_raw(), SOAP_STR_EOS, and soap_dime::type.

Referenced by soap_envelope_begin_out(), and soap_putdime().

14468  {
14469  unsigned char tmp[12];
14470  size_t optlen = 0, idlen = 0, typelen = 0;
14471  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Put DIME header id='%s'\n", soap->dime.id ? soap->dime.id : SOAP_STR_EOS));
14472 
14473  if (soap->dime.options)
14474  optlen = (((unsigned char)soap->dime.options[2] << 8) | ((unsigned char)soap->dime.options[3])) + 4;
14475 
14476  if (soap->dime.id)
14477  {
14478  idlen = strlen(soap->dime.id);
14479 
14480  if (idlen > 0x0000FFFF)
14481  idlen = 0x0000FFFF;
14482  }
14483 
14484  if (soap->dime.type)
14485  {
14486  typelen = strlen(soap->dime.type);
14487 
14488  if (typelen > 0x0000FFFF)
14489  typelen = 0x0000FFFF;
14490  }
14491 
14492  tmp[0] = SOAP_DIME_VERSION | (soap->dime.flags & 0x7);
14493  tmp[1] = soap->dime.flags & 0xF0;
14494  tmp[2] = (char)(optlen >> 8);
14495  tmp[3] = (char)(optlen & 0xFF);
14496  tmp[4] = (char)(idlen >> 8);
14497  tmp[5] = (char)(idlen & 0xFF);
14498  tmp[6] = (char)(typelen >> 8);
14499  tmp[7] = (char)(typelen & 0xFF);
14500  tmp[8] = (char)(soap->dime.size >> 24);
14501  tmp[9] = (char)((soap->dime.size >> 16) & 0xFF);
14502  tmp[10] = (char)((soap->dime.size >> 8) & 0xFF);
14503  tmp[11] = (char)(soap->dime.size & 0xFF);
14504 
14505  if (soap_send_raw(soap, (char*)tmp, 12)
14506  || soap_putdimefield(soap, soap->dime.options, optlen)
14507  || soap_putdimefield(soap, soap->dime.id, idlen)
14508  || soap_putdimefield(soap, soap->dime.type, typelen))
14509  return soap->error;
14510 
14511  return SOAP_OK;
14512  }
int error
Definition: stdsoap2.h:1755
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
size_t size
Definition: stdsoap2.h:1388
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_dime dime
Definition: stdsoap2.h:1760
const char * options
Definition: stdsoap2.h:1395
#define SOAP_DIME_VERSION
Definition: stdsoap2.h:1071
const char * type
Definition: stdsoap2.h:1394
static int soap_putdimefield(struct soap *, const char *, size_t)
Definition: stdsoap2.cpp:14420
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
const char * id
Definition: stdsoap2.h:1393
char flags
Definition: stdsoap2.h:1391
int soap_putfault ( struct soap )

Definition at line 98 of file soapC.cpp.

References soap::fault, SOAP_OK, and soap_put_SOAP_ENV__Fault().

Referenced by soap_send_fault().

99 {
100  if (soap->fault)
101  return soap_put_SOAP_ENV__Fault(soap, soap->fault, "SOAP-ENV:Fault", NULL);
102 
103  return SOAP_OK;
104 }
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
int soap_put_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a, const char *tag, const char *type)
Definition: soapC.cpp:2102
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_putheader ( struct soap )

Definition at line 33 of file soapC.cpp.

References soap::error, soap::header, soap::part, SOAP_END_HEADER, SOAP_IN_HEADER, SOAP_OK, and soap_out_SOAP_ENV__Header().

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_send_fault().

34 {
35  if (soap->header)
36  {
38 
39  if (soap_out_SOAP_ENV__Header(soap, "SOAP-ENV:Header", 0, soap->header, NULL))
40  return soap->error;
41 
43  }
44 
45  return SOAP_OK;
46 }
int error
Definition: stdsoap2.h:1755
short part
Definition: stdsoap2.h:1729
#define SOAP_END_HEADER
Definition: stdsoap2.h:1157
int soap_out_SOAP_ENV__Header(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Header *a, const char *type)
Definition: soapC.cpp:2809
struct SOAP_ENV__Header * header
Definition: stdsoap2.h:1631
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_IN_HEADER
Definition: stdsoap2.h:1156
int soap_puthex ( struct soap ,
const unsigned char *  ,
int   
)

Definition at line 2200 of file stdsoap2.cpp.

References soap_dom_element::data, soap::dom, soap::error, soap::mode, SOAP_OK, soap_s2hex(), soap_send_raw(), and SOAP_XML_DOM.

2201  {
2202  char d[2];
2203  register int i;
2204 #ifdef WITH_DOM
2205 
2206  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
2207  {
2208  if (!(soap->dom->data = soap_s2hex(soap, s, NULL, n)))
2209  return soap->error;
2210 
2211  return SOAP_OK;
2212  }
2213 
2214 #endif
2215 
2216  for (i = 0; i < n; i++)
2217  {
2218  register int m = *s++;
2219  d[0] = (char)((m >> 4) + (m > 159 ? '7' : '0'));
2220  m &= 0x0F;
2221  d[1] = (char)(m + (m > 9 ? '7' : '0'));
2222 
2223  if (soap_send_raw(soap, d, 2))
2224  return soap->error;
2225  }
2226 
2227  return SOAP_OK;
2228  }
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define SOAP_OK
Definition: stdsoap2.h:995
char * soap_s2hex(struct soap *soap, const unsigned char *s, char *t, int n)
Definition: stdsoap2.cpp:18151
int soap_puthttphdr ( struct soap ,
int  status,
size_t  count 
)

Definition at line 18241 of file stdsoap2.cpp.

References soap_mime::boundary, soap::fposthdr, soap::http_content, soap::keep_alive, soap::mime, soap::mode, soap::omode, SOAP_ENC_DIME, SOAP_ENC_MIME, SOAP_ENC_MTOM, SOAP_ENC_ZLIB, SOAP_FILE, SOAP_GET, SOAP_HTML, SOAP_IO, SOAP_IO_CHUNK, SOAP_OK, SOAP_STR_EOS, SOAP_ZLIB_DEFLATE, soap_mime::start, soap::status, soap::tmpbuf, soap::version, and soap::zlib_out.

Referenced by http_post(), and http_response().

18242  {
18243  if (soap->status != SOAP_GET)
18244  {
18245  register const char *s = "text/xml; charset=utf-8";
18246  register int err = SOAP_OK;
18247 #ifndef WITH_LEANER
18248  register const char *r = NULL;
18249 #endif
18250 
18251  if (status == SOAP_FILE && soap->http_content)
18252  s = soap->http_content;
18253  else if (status == SOAP_HTML)
18254  s = "text/html; charset=utf-8";
18255  else if (count || ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK))
18256  {
18257  if (soap->version == 2)
18258  s = "application/soap+xml; charset=utf-8";
18259  }
18260 
18261 #ifndef WITH_LEANER
18262 
18263  if (soap->mode & (SOAP_ENC_DIME | SOAP_ENC_MTOM))
18264  {
18265  if (soap->mode & SOAP_ENC_MTOM)
18266  {
18267  r = s;
18268  s = "application/xop+xml; charset=utf-8";
18269  }
18270  else
18271  s = "application/dime";
18272  }
18273 
18274  if ((soap->mode & SOAP_ENC_MIME) && soap->mime.boundary && strlen(soap->mime.boundary) + strlen(soap->mime.start ? soap->mime.start : SOAP_STR_EOS) < sizeof(soap->tmpbuf) - 80)
18275  {
18276  register const char *t = strchr(s, ';');
18277  sprintf(soap->tmpbuf, "multipart/related; boundary=\"%s\"; type=\"", soap->mime.boundary);
18278 
18279  if (t)
18280  {
18281  strncat(soap->tmpbuf, s, t - s);
18282  soap->tmpbuf[sizeof(soap->tmpbuf) - 1] = '\0';
18283  }
18284  else
18285  strcat(soap->tmpbuf, s);
18286 
18287  if (soap->mime.start)
18288  {
18289  strcat(soap->tmpbuf, "\"; start=\"");
18290  strcat(soap->tmpbuf, soap->mime.start);
18291  }
18292 
18293  strcat(soap->tmpbuf, "\"");
18294 
18295  if (r)
18296  {
18297  strcat(soap->tmpbuf, "; start-info=\"");
18298  strcat(soap->tmpbuf, r);
18299  strcat(soap->tmpbuf, "\"");
18300  }
18301 
18302  s = soap->tmpbuf;
18303  }
18304 
18305 #endif
18306 
18307  if (s && (err = soap->fposthdr(soap, "Content-Type", s)))
18308  return err;
18309 
18310 #ifdef WITH_ZLIB
18311 
18312  if ((soap->omode & SOAP_ENC_ZLIB))
18313  {
18314 #ifdef WITH_GZIP
18315  err = soap->fposthdr(soap, "Content-Encoding", soap->zlib_out == SOAP_ZLIB_DEFLATE ? "deflate" : "gzip");
18316 #else
18317  err = soap->fposthdr(soap, "Content-Encoding", "deflate");
18318 #endif
18319 
18320  if (err)
18321  return err;
18322  }
18323 
18324 #endif
18325 #ifndef WITH_LEANER
18326 
18327  if ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK)
18328  err = soap->fposthdr(soap, "Transfer-Encoding", "chunked");
18329  else
18330 #endif
18331  if (s)
18332  {
18333  sprintf(soap->tmpbuf, "%lu", (unsigned long)count);
18334  err = soap->fposthdr(soap, "Content-Length", soap->tmpbuf);
18335  }
18336 
18337  if (err)
18338  return err;
18339  }
18340 
18341  return soap->fposthdr(soap, "Connection", soap->keep_alive ? "keep-alive" : "close");
18342  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
#define SOAP_FILE
Definition: stdsoap2.h:1059
short keep_alive
Definition: stdsoap2.h:1742
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_ENC_MTOM
Definition: stdsoap2.h:1101
short version
Definition: stdsoap2.h:1600
#define SOAP_IO
Definition: stdsoap2.h:1086
#define SOAP_ZLIB_DEFLATE
Definition: stdsoap2.h:1078
#define SOAP_GET
Definition: stdsoap2.h:1064
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
const char * http_content
Definition: stdsoap2.h:1608
soap_mode omode
Definition: stdsoap2.h:1603
int(* fposthdr)(struct soap *, const char *, const char *)
Definition: stdsoap2.h:1644
const char * start
Definition: stdsoap2.h:1411
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1102
char * boundary
Definition: stdsoap2.h:1410
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
int status
Definition: stdsoap2.h:1754
#define SOAP_HTML
Definition: stdsoap2.h:1058
struct soap_mime mime
Definition: stdsoap2.h:1761
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
short zlib_out
Definition: stdsoap2.h:1827
int soap_putmime ( struct soap )

Definition at line 15330 of file stdsoap2.cpp.

References soap_mime::boundary, DBGLOG, soap_multipart::description, soap::error, soap_mime::first, soap::fmimeread, soap::fmimereadclose, soap::fmimereadopen, soap_multipart::id, soap::mime, soap::mode, soap_multipart::next, soap_multipart::ptr, soap_multipart::size, SOAP_ENC_MIME, SOAP_ENC_XML, SOAP_EOF, SOAP_IO, SOAP_IO_CHUNK, SOAP_IO_STORE, SOAP_OK, soap_putmimehdr(), soap_send3(), soap_send_raw(), soap::tmpbuf, and soap_multipart::type.

Referenced by soap_end_send().

15331  {
15332  struct soap_multipart *content;
15333 
15334  if (!(soap->mode & SOAP_ENC_MIME) || !soap->mime.boundary)
15335  return SOAP_OK;
15336 
15337  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending MIME attachments\n"));
15338 
15339  for (content = soap->mime.first; content; content = content->next)
15340  {
15341  void * handle;
15342 
15343  if (soap->fmimereadopen && ((handle = soap->fmimereadopen(soap, (void*)content->ptr, content->id, content->type, content->description)) || soap->error))
15344  {
15345  size_t size = content->size;
15346 
15347  if (!handle)
15348  {
15349  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimereadopen failed\n"));
15350  return soap->error;
15351  }
15352 
15353  if (soap_putmimehdr(soap, content))
15354  return soap->error;
15355 
15356  if (!size)
15357  {
15359  {
15360  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked streaming MIME\n"));
15361 
15362  do
15363  {
15364  size = soap->fmimeread(soap, handle, soap->tmpbuf, sizeof(soap->tmpbuf));
15365  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimeread returned %lu bytes\n", (unsigned long)size));
15366 
15367  if (soap_send_raw(soap, soap->tmpbuf, size))
15368  break;
15369  }
15370  while (size);
15371  }
15372  else
15373  {
15374  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error: cannot chunk streaming MIME (no HTTP chunking)\n"));
15375  }
15376  }
15377  else
15378  {
15379  do
15380  {
15381  size_t bufsize;
15382 
15383  if (size < sizeof(soap->tmpbuf))
15384  bufsize = size;
15385  else
15386  bufsize = sizeof(soap->tmpbuf);
15387 
15388  if (!(bufsize = soap->fmimeread(soap, handle, soap->tmpbuf, bufsize)))
15389  {
15390  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fmimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)content->size));
15391  soap->error = SOAP_EOF;
15392  break;
15393  }
15394 
15395  if (soap_send_raw(soap, soap->tmpbuf, bufsize))
15396  break;
15397 
15398  size -= bufsize;
15399  }
15400  while (size);
15401  }
15402 
15403  if (soap->fmimereadclose)
15404  soap->fmimereadclose(soap, handle);
15405  }
15406  else
15407  {
15408  if (soap_putmimehdr(soap, content)
15409  || soap_send_raw(soap, content->ptr, content->size))
15410  return soap->error;
15411  }
15412  }
15413 
15414  return soap_send3(soap, "\r\n--", soap->mime.boundary, "--");
15415  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
const char * id
Definition: stdsoap2.h:1444
int soap_putmimehdr(struct soap *soap, struct soap_multipart *content)
Definition: stdsoap2.cpp:15294
void *(* fmimereadopen)(struct soap *, void *, const char *, const char *, const char *)
Definition: stdsoap2.h:1676
int error
Definition: stdsoap2.h:1755
struct soap_multipart * first
Definition: stdsoap2.h:1413
void(* fmimereadclose)(struct soap *, void *)
Definition: stdsoap2.h:1678
soap_mode mode
Definition: stdsoap2.h:1601
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define SOAP_IO
Definition: stdsoap2.h:1086
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int soap_send3(struct soap *soap, const char *s1, const char *s2, const char *s3)
Definition: stdsoap2.cpp:990
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
size_t(* fmimeread)(struct soap *, void *, char *, size_t)
Definition: stdsoap2.h:1680
struct soap_multipart * next
Definition: stdsoap2.h:1441
char * boundary
Definition: stdsoap2.h:1410
#define SOAP_OK
Definition: stdsoap2.h:995
const char * description
Definition: stdsoap2.h:1449
#define SOAP_IO_STORE
Definition: stdsoap2.h:1089
#define SOAP_ENC_XML
Definition: stdsoap2.h:1098
struct soap_mime mime
Definition: stdsoap2.h:1761
#define SOAP_EOF
Definition: stdsoap2.h:993
const char * type
Definition: stdsoap2.h:1445
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
int soap_putmimehdr ( struct soap ,
struct soap_multipart  
)

Definition at line 15294 of file stdsoap2.cpp.

References soap_mime::boundary, DBGLOG, soap_multipart::description, soap_multipart::encoding, soap::error, soap_multipart::id, soap_multipart::location, soap::mime, soap_code_str(), soap_send3(), soap_send_raw(), SOAP_STR_EOS, and soap_multipart::type.

Referenced by soap_putmime().

15295  {
15296  const char *s;
15297  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "MIME attachment type=%s\n", content->type ? content->type : SOAP_STR_EOS));
15298 
15299  if (soap_send3(soap, "\r\n--", soap->mime.boundary, "\r\n"))
15300  return soap->error;
15301 
15302  if (content->type && soap_send3(soap, "Content-Type: ", content->type, "\r\n"))
15303  return soap->error;
15304 
15305  s = soap_code_str(mime_codes, content->encoding);
15306 
15307  if (s && soap_send3(soap, "Content-Transfer-Encoding: ", s, "\r\n"))
15308  return soap->error;
15309 
15310  if (content->id && soap_send3(soap, "Content-ID: ", content->id, "\r\n"))
15311  return soap->error;
15312 
15313  if (content->location && soap_send3(soap, "Content-Location: ", content->location, "\r\n"))
15314  return soap->error;
15315 
15316  if (content->description && soap_send3(soap, "Content-Description: ", content->description, "\r\n"))
15317  return soap->error;
15318 
15319  return soap_send_raw(soap, "\r\n", 2);
15320  }
int error
Definition: stdsoap2.h:1755
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int soap_send3(struct soap *soap, const char *s1, const char *s2, const char *s3)
Definition: stdsoap2.cpp:990
char id[(1024)]
Definition: stdsoap2.h:1714
char * boundary
Definition: stdsoap2.h:1410
char type[(1024)]
Definition: stdsoap2.h:1716
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
struct soap_mime mime
Definition: stdsoap2.h:1761
static const struct soap_code_map mime_codes[]
Definition: stdsoap2.cpp:502
const char * soap_code_str(const struct soap_code_map *code_map, long code)
Definition: stdsoap2.cpp:1682
char* soap_putoffset ( struct soap ,
int   
)

Definition at line 3289 of file stdsoap2.cpp.

References soap_putoffsets().

3290  {
3291  return soap_putoffsets(soap, &offset, 1);
3292  }
char * soap_putoffsets(struct soap *soap, const int *offset, int dim)
Definition: stdsoap2.cpp:3300
char* soap_putoffsets ( struct soap ,
const int *  ,
int   
)

Definition at line 3300 of file stdsoap2.cpp.

References soap::arrayOffset.

Referenced by soap_putoffset().

3301  {
3302  register int i;
3303  sprintf(soap->arrayOffset, "[%d", offset[0]);
3304 
3305  for (i = 1; i < dim; i++)
3306  sprintf(soap->arrayOffset + strlen(soap->arrayOffset), ",%d", offset[i]);
3307 
3308  strcat(soap->arrayOffset, "]");
3309  return soap->arrayOffset;
3310  }
char arrayOffset[(1024)]
Definition: stdsoap2.h:1719
char* soap_putsize ( struct soap ,
const char *  ,
int   
)

Definition at line 3224 of file stdsoap2.cpp.

References soap_putsizes().

Referenced by soap_out_ArrayOf_USCORExsd_USCOREstring().

3225  {
3226  return soap_putsizes(soap, type, &size, 1);
3227  }
char * soap_putsizes(struct soap *soap, const char *type, const int *size, int dim)
Definition: stdsoap2.cpp:3235
const char * type
Definition: stdsoap2.h:1445
char* soap_putsizes ( struct soap ,
const char *  ,
const int *  ,
int   
)

Definition at line 3235 of file stdsoap2.cpp.

References soap_putsizesoffsets().

Referenced by soap_putsize().

3236  {
3237  return soap_putsizesoffsets(soap, type, size, NULL, dim);
3238  }
char * soap_putsizesoffsets(struct soap *soap, const char *type, const int *size, const int *offset, int dim)
Definition: stdsoap2.cpp:3246
const char * type
Definition: stdsoap2.h:1445
char* soap_putsizesoffsets ( struct soap ,
const char *  ,
const int *  ,
const int *  ,
int   
)

Definition at line 3246 of file stdsoap2.cpp.

References soap::type, and soap::version.

Referenced by soap_putsizes().

3247  {
3248  int i;
3249 
3250  if (!type)
3251  return NULL;
3252 
3253  if (soap->version == 2)
3254  {
3255  sprintf(soap->type, "%s[%d", type, size[0]);
3256 
3257  for (i = 1; i < dim; i++)
3258  sprintf(soap->type + strlen(soap->type), " %d", size[i]);
3259  }
3260  else
3261  {
3262  if (offset)
3263  {
3264  sprintf(soap->type, "%s[%d", type, size[0] + offset[0]);
3265 
3266  for (i = 1; i < dim; i++)
3267  sprintf(soap->type + strlen(soap->type), ",%d", size[i] + offset[i]);
3268  }
3269  else
3270  {
3271  sprintf(soap->type, "%s[%d", type, size[0]);
3272 
3273  for (i = 1; i < dim; i++)
3274  sprintf(soap->type + strlen(soap->type), ",%d", size[i]);
3275  }
3276 
3277  strcat(soap->type, "]");
3278  }
3279 
3280  return soap->type;
3281  }
short version
Definition: stdsoap2.h:1600
char type[(1024)]
Definition: stdsoap2.h:1716
const char * type
Definition: stdsoap2.h:1445
int soap_pututf8 ( struct soap ,
unsigned  long 
)
const char* soap_QName2s ( struct soap ,
const char *   
)

Definition at line 13359 of file stdsoap2.cpp.

References Namespace::id, soap::idnum, Namespace::in, soap::labbuf, soap::labidx, soap::local_namespaces, soap::mode, Namespace::ns, soap_append_lab(), soap_blank, soap_set_attr(), SOAP_STR_EOS, soap_strdup(), soap_tag_cmp(), soap_utilize_ns(), SOAP_XML_CANONICAL, and soap::tmpbuf.

Referenced by soap_out_SOAP_ENV__Code(), and soap_out_SOAP_ENV__Fault().

13360  {
13361  const char *t = NULL;
13362 
13363  if (s)
13364  {
13365  soap->labidx = 0;
13366 
13367  for (;;)
13368  {
13369  size_t n;
13370 
13371  /* skip blanks */
13372  while (*s && soap_blank(*s))
13373  s++;
13374 
13375  if (!*s)
13376  break;
13377 
13378  /* find next QName */
13379  n = 1;
13380 
13381  while (s[n] && !soap_blank(s[n]))
13382  n++;
13383 
13384  /* normal prefix: pass string as is */
13385  if (*s != '"')
13386  {
13387  soap_append_lab(soap, s, n);
13388 #ifndef WITH_LEAN
13389 
13390  if ((soap->mode & SOAP_XML_CANONICAL))
13391  {
13392  const char *r = strchr(s, ':');
13393 
13394  if (r)
13395  soap_utilize_ns(soap, s, r - s);
13396  }
13397 
13398 #endif
13399  }
13400  else /* URL-based string prefix */
13401  {
13402  const char *q;
13403  s++;
13404  q = strchr(s, '"');
13405 
13406  if (q)
13407  {
13408  struct Namespace *p = soap->local_namespaces;
13409 
13410  if (p)
13411  {
13412  for (; p->id; p++)
13413  {
13414  if (p->ns)
13415  if (!soap_tag_cmp(s, p->ns))
13416  break;
13417 
13418  if (p->in)
13419  if (!soap_tag_cmp(s, p->in))
13420  break;
13421  }
13422  }
13423 
13424  /* URL is in the namespace table? */
13425  if (p && p->id)
13426  {
13427  soap_append_lab(soap, p->id, strlen(p->id));
13428  }
13429  else /* not in namespace table: create xmlns binding */
13430  {
13431  char *r = soap_strdup(soap, s);
13432  r[q - s] = '\0';
13433  sprintf(soap->tmpbuf, "xmlns:_%d", soap->idnum++);
13434  soap_set_attr(soap, soap->tmpbuf, r);
13435  soap_append_lab(soap, soap->tmpbuf + 6, strlen(soap->tmpbuf + 6));
13436  }
13437 
13438  soap_append_lab(soap, q + 1, n - (q - s) - 1);
13439  }
13440  }
13441 
13442  /* advance to next and add spacing */
13443  s += n;
13444 
13445  if (*s)
13446  soap_append_lab(soap, " ", 1);
13447  }
13448 
13450  t = soap_strdup(soap, soap->labbuf);
13451  }
13452 
13453  return t;
13454  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
const char * in
Definition: stdsoap2.h:1264
soap_mode mode
Definition: stdsoap2.h:1601
int soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:3657
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
#define soap_blank(c)
Definition: stdsoap2.cpp:118
const char * ns
Definition: stdsoap2.h:1263
size_t labidx
Definition: stdsoap2.h:1709
char * labbuf
Definition: stdsoap2.h:1707
int soap_append_lab(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:10289
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
int idnum
Definition: stdsoap2.h:1633
static void soap_utilize_ns(struct soap *soap, const char *tag, size_t n)
Definition: stdsoap2.cpp:8976
int soap_set_attr(struct soap *soap, const char *name, const char *value)
Definition: stdsoap2.cpp:10035
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
const char * id
Definition: stdsoap2.h:1262
int soap_receiver_fault ( struct soap ,
const char *  ,
const char *   
)

Definition at line 19271 of file stdsoap2.cpp.

References soap_receiver_fault_subcode().

19272  {
19273  return soap_receiver_fault_subcode(soap, NULL, faultstring, faultdetailXML);
19274  }
int soap_receiver_fault_subcode(struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML)
Definition: stdsoap2.cpp:19282
int soap_receiver_fault_subcode ( struct soap ,
const char *  ,
const char *  ,
const char *   
)

Definition at line 19282 of file stdsoap2.cpp.

References soap_copy_fault(), and soap::version.

Referenced by soap_receiver_fault().

19283  {
19284  return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : "SOAP-ENV:Server", faultsubcodeQName, faultstring, faultdetailXML);
19285  }
static int soap_copy_fault(struct soap *, const char *, const char *, const char *, const char *)
Definition: stdsoap2.cpp:19227
short version
Definition: stdsoap2.h:1600
int soap_recv ( struct soap )

Definition at line 1519 of file stdsoap2.cpp.

References soap::buf, soap::bufidx, soap_dime::buflen, soap::buflen, soap_dime::chunksize, soap::count, DBGLOG, soap::dime, soap_dime::flags, soap::mode, soap_dime::size, SOAP_DIME_CF, SOAP_ENC_DIME, SOAP_OK, and soap_recv_raw().

Referenced by soap_getdime().

1520  {
1521 #ifndef WITH_LEANER
1522 
1523  if (soap->mode & SOAP_ENC_DIME)
1524  {
1525  if (soap->dime.buflen)
1526  {
1527  char *s;
1528  int i;
1529  unsigned char tmp[12];
1530  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME hdr for chunked DIME is in buffer\n"));
1531  soap->count += soap->dime.buflen - soap->buflen;
1532  soap->buflen = soap->dime.buflen;
1533  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Skip padding (%ld bytes)\n", -(long)soap->dime.size&3));
1534 
1535  for (i = -(long)soap->dime.size & 3; i > 0; i--)
1536  {
1537  soap->bufidx++;
1538 
1539  if (soap->bufidx >= soap->buflen)
1540  if (soap_recv_raw(soap))
1541  return EOF;
1542  }
1543 
1544  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME hdr for next chunk\n"));
1545  s = (char*)tmp;
1546 
1547  for (i = 12; i > 0; i--)
1548  {
1549  *s++ = soap->buf[soap->bufidx++];
1550 
1551  if (soap->bufidx >= soap->buflen)
1552  if (soap_recv_raw(soap))
1553  return EOF;
1554  }
1555 
1556  soap->dime.flags = tmp[0] & 0x7;
1557  soap->dime.size = ((size_t)tmp[8] << 24) | ((size_t)tmp[9] << 16) | ((size_t)tmp[10] << 8) | ((size_t)tmp[11]);
1558  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME chunk (%u bytes)\n", (unsigned int)soap->dime.size));
1559 
1560  if (soap->dime.flags & SOAP_DIME_CF)
1561  {
1562  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "More chunking\n"));
1564 
1565  if (soap->buflen - soap->bufidx >= soap->dime.size)
1566  {
1567  soap->dime.buflen = soap->buflen;
1569  }
1570  else
1572  }
1573  else
1574  {
1575  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Last chunk\n"));
1576  soap->dime.buflen = 0;
1577  soap->dime.chunksize = 0;
1578  }
1579 
1580  soap->count = soap->buflen - soap->bufidx;
1581  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%u bytes remaining\n", (unsigned int)soap->count));
1582  return SOAP_OK;
1583  }
1584 
1585  if (soap->dime.chunksize)
1586  {
1587  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get next DIME hdr for chunked DIME (%u bytes chunk)\n", (unsigned int)soap->dime.chunksize));
1588 
1589  if (soap_recv_raw(soap))
1590  return EOF;
1591 
1592  if (soap->buflen - soap->bufidx >= soap->dime.chunksize)
1593  {
1594  soap->dime.buflen = soap->buflen;
1597  }
1598  else
1600 
1601  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%lu bytes remaining, count=%u\n", (unsigned long)(soap->buflen - soap->bufidx), (unsigned int)soap->count));
1602  return SOAP_OK;
1603  }
1604  }
1605 
1606 #endif
1607  return soap_recv_raw(soap);
1608  }
size_t chunksize
Definition: stdsoap2.h:1389
soap_mode mode
Definition: stdsoap2.h:1601
size_t size
Definition: stdsoap2.h:1388
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_dime dime
Definition: stdsoap2.h:1760
char buf[(65536)]
Definition: stdsoap2.h:1710
int soap_recv_raw(struct soap *soap)
Definition: stdsoap2.cpp:1292
size_t bufidx
Definition: stdsoap2.h:1699
#define SOAP_DIME_CF
Definition: stdsoap2.h:1068
#define SOAP_OK
Definition: stdsoap2.h:995
char flags
Definition: stdsoap2.h:1391
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
size_t buflen
Definition: stdsoap2.h:1390
size_t buflen
Definition: stdsoap2.h:1700
size_t count
Definition: stdsoap2.h:1705
int soap_recv_empty_response ( struct soap )

Definition at line 19113 of file stdsoap2.cpp.

References soap::error, soap_begin_recv(), soap_closesock(), soap_end_recv(), SOAP_NO_DATA, and SOAP_OK.

19114  {
19115  if (!soap_begin_recv(soap))
19117  else if (soap->error == SOAP_NO_DATA || soap->error == 202)
19118  soap->error = SOAP_OK;
19119 
19120  return soap_closesock(soap);
19121  }
int error
Definition: stdsoap2.h:1755
int soap_begin_recv(struct soap *soap)
Definition: stdsoap2.cpp:16617
int soap_end_recv(struct soap *soap)
Definition: stdsoap2.cpp:7925
int soap_closesock(struct soap *soap)
Definition: stdsoap2.cpp:6121
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_NO_DATA
Definition: stdsoap2.h:1009
int soap_recv_fault ( struct soap )

Definition at line 19038 of file stdsoap2.cpp.

References DBGLOG, soap::error, soap_body_end_in(), SOAP_CLI_FAULT, soap_closesock(), soap_end_recv(), soap_envelope_end_in(), SOAP_FAULT, soap_faultcode(), soap_getfault(), soap_match_tag(), SOAP_MUSTUNDERSTAND, SOAP_OK, soap_set_fault(), SOAP_SVR_FAULT, SOAP_VERSIONMISMATCH, and soap::version.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), and MiriamWebServicesSoapBindingProxy::isDeprecated().

19039  {
19040  register int status = soap->error;
19041  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Receiving SOAP Fault\n"));
19042  soap->error = SOAP_OK;
19043 
19044  if (soap_getfault(soap))
19045  {
19046  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error: soap_get_soapfault() failed. Is this a SOAP message at all?\n"));
19047  *soap_faultcode(soap) = (soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client");
19048  soap->error = status;
19050  }
19051  else
19052  {
19053  register const char *s = *soap_faultcode(soap);
19054 
19055  if (!soap_match_tag(soap, s, "SOAP-ENV:Server") || !soap_match_tag(soap, s, "SOAP-ENV:Receiver"))
19056  status = SOAP_SVR_FAULT;
19057  else if (!soap_match_tag(soap, s, "SOAP-ENV:Client") || !soap_match_tag(soap, s, "SOAP-ENV:Sender"))
19058  status = SOAP_CLI_FAULT;
19059  else if (!soap_match_tag(soap, s, "SOAP-ENV:MustUnderstand"))
19060  status = SOAP_MUSTUNDERSTAND;
19061  else if (!soap_match_tag(soap, s, "SOAP-ENV:VersionMismatch"))
19062  status = SOAP_VERSIONMISMATCH;
19063  else
19064  {
19065  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Fault code %s\n", s));
19066  status = SOAP_FAULT;
19067  }
19068 
19069  if (soap_body_end_in(soap)
19071  || soap_end_recv(soap))
19072  return soap_closesock(soap);
19073 
19074  soap->error = status;
19075  }
19076 
19077  return soap_closesock(soap);
19078  }
#define SOAP_FAULT
Definition: stdsoap2.h:1007
#define SOAP_MUSTUNDERSTAND
Definition: stdsoap2.h:1003
int soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
Definition: stdsoap2.cpp:3727
int error
Definition: stdsoap2.h:1755
int soap_end_recv(struct soap *soap)
Definition: stdsoap2.cpp:7925
void soap_set_fault(struct soap *soap)
Definition: stdsoap2.cpp:18724
short version
Definition: stdsoap2.h:1600
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int soap_envelope_end_in(struct soap *soap)
Definition: stdsoap2.cpp:17632
int soap_body_end_in(struct soap *soap)
Definition: stdsoap2.cpp:17704
#define SOAP_VERSIONMISMATCH
Definition: stdsoap2.h:1034
#define SOAP_SVR_FAULT
Definition: stdsoap2.h:997
int soap_getfault(struct soap *soap)
Definition: soapC.cpp:106
const char ** soap_faultcode(struct soap *soap)
Definition: soapC.cpp:111
int soap_closesock(struct soap *soap)
Definition: stdsoap2.cpp:6121
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_CLI_FAULT
Definition: stdsoap2.h:996
int soap_recv_header ( struct soap )

Definition at line 17719 of file stdsoap2.cpp.

References soap::error, soap::fheader, soap_getheader(), SOAP_OK, and SOAP_TAG_MISMATCH.

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), and MiriamWebServicesSoapBindingProxy::isDeprecated().

17720  {
17722  soap->error = SOAP_OK;
17723  else if (soap->error == SOAP_OK && soap->fheader)
17724  soap->error = soap->fheader(soap);
17725 
17726  return soap->error;
17727  }
int(* fheader)(struct soap *)
Definition: stdsoap2.h:1648
int error
Definition: stdsoap2.h:1755
int soap_getheader(struct soap *soap)
Definition: soapC.cpp:48
#define SOAP_TAG_MISMATCH
Definition: stdsoap2.h:998
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_recv_raw ( struct soap )

Definition at line 1292 of file stdsoap2.cpp.

References soap::ahead, soap::buf, soap::bufidx, soap::buflen, soap::chunkbuflen, soap::chunksize, soap::count, soap::d_stream, DBGLOG, DBGMSG, soap::error, soap::fpreparerecv, soap::frecv, soap::mode, SOAP_BUFLEN, SOAP_ENC_ZLIB, soap_getchunkchar(), SOAP_IO, SOAP_IO_CHUNK, soap_isxdigit(), SOAP_OK, SOAP_STR_EOS, soap_strtoul, SOAP_ZLIB_ERROR, SOAP_ZLIB_GZIP, soap::socket, soap::z_buf, soap::z_buflen, soap::z_crc, soap::z_ratio_in, and soap::zlib_in.

Referenced by soap_recv().

1293  {
1294  register size_t ret;
1295 #ifdef WITH_ZLIB
1296 
1297  if (soap->mode & SOAP_ENC_ZLIB)
1298  {
1299  if (soap->d_stream->next_out == Z_NULL)
1300  return EOF;
1301 
1302  if (soap->d_stream->avail_in || !soap->d_stream->avail_out)
1303  {
1304  register int r;
1305  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflating\n"));
1306  soap->d_stream->next_out = (Byte*)soap->buf;
1307  soap->d_stream->avail_out = SOAP_BUFLEN;
1308  r = inflate(soap->d_stream, Z_NO_FLUSH);
1309 
1310  if (r == Z_OK || r == Z_STREAM_END)
1311  {
1312  soap->bufidx = 0;
1313  ret = soap->buflen = SOAP_BUFLEN - soap->d_stream->avail_out;
1314 
1315  if (soap->zlib_in == SOAP_ZLIB_GZIP)
1316  soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)ret);
1317 
1318  if (r == Z_STREAM_END)
1319  {
1320  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out));
1321  soap->z_ratio_in = (float)soap->d_stream->total_in / (float)soap->d_stream->total_out;
1322  soap->d_stream->next_out = Z_NULL;
1323  }
1324 
1325  if (ret)
1326  {
1327  soap->count += ret;
1328  DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- decompressed ----\n"));
1329  DBGMSG(RECV, soap->buf, ret);
1330  DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n----\n"));
1331  return SOAP_OK;
1332  }
1333  }
1334  else if (r != Z_BUF_ERROR)
1335  {
1336  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate error: %s\n", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS));
1337  soap->d_stream->next_out = Z_NULL;
1339  return EOF;
1340  }
1341  }
1342 
1343 zlib_again:
1344 
1345  if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK && !soap->chunksize)
1346  {
1347  memcpy(soap->buf, soap->z_buf, SOAP_BUFLEN);
1348  soap->buflen = soap->z_buflen;
1349  }
1350 
1351  DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- compressed ----\n"));
1352  }
1353 
1354 #endif
1355 #ifndef WITH_NOHTTP
1356 
1357  if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) /* read HTTP chunked transfer */
1358  {
1359  for (;;)
1360  {
1361  register soap_wchar c;
1362  char *t, tmp[8];
1363 
1364  if (soap->chunksize)
1365  {
1367  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk: read %u bytes\n", (unsigned int)ret));
1368  DBGMSG(RECV, soap->buf, ret);
1369  soap->bufidx = 0;
1370  soap->chunksize -= ret;
1371  break;
1372  }
1373 
1374  t = tmp;
1375 
1376  if (!soap->chunkbuflen)
1377  {
1378  soap->chunkbuflen = ret = soap->frecv(soap, soap->buf, SOAP_BUFLEN);
1379  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes (chunked) from socket %d\n", (unsigned int)ret, soap->socket));
1380  DBGMSG(RECV, soap->buf, ret);
1381  soap->bufidx = 0;
1382 
1383  if (!ret)
1384  return soap->ahead = EOF;
1385  }
1386  else
1387  soap->bufidx = soap->buflen;
1388 
1390  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk size (idx=%u len=%u)\n", (unsigned int)soap->bufidx, (unsigned int)soap->buflen));
1391 
1392  while (!soap_isxdigit((int)(c = soap_getchunkchar(soap))))
1393  {
1394  if ((int)c == EOF)
1395  return soap->ahead = EOF;
1396  }
1397 
1398  do
1399  *t++ = (char)c;
1400 
1401  while (soap_isxdigit((int)(c = soap_getchunkchar(soap))) && t - tmp < 7);
1402 
1403  while ((int)c != EOF && c != '\n')
1404  c = soap_getchunkchar(soap);
1405 
1406  if ((int)c == EOF)
1407  return soap->ahead = EOF;
1408 
1409  *t = '\0';
1410  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunk size = %s (hex)\n", tmp));
1411  soap->chunksize = soap_strtoul(tmp, &t, 16);
1412 
1413  if (!soap->chunksize)
1414  {
1415  soap->chunkbuflen = 0;
1416  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of chunked message\n"));
1417 
1418  while ((int)c != EOF && c != '\n')
1419  c = soap_getchunkchar(soap);
1420 
1421  ret = 0;
1422  soap->ahead = EOF;
1423  break;
1424  }
1425 
1427  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Moving buf len to idx=%u len=%u (%s)\n", (unsigned int)soap->bufidx, (unsigned int)soap->buflen, tmp));
1428 
1429  if (soap->buflen > soap->chunkbuflen)
1430  {
1432  soap->chunksize -= soap->buflen - soap->bufidx;
1433  soap->chunkbuflen = 0;
1434  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Passed end of buffer for chunked HTTP (%u bytes left)\n", (unsigned int)(soap->buflen - soap->bufidx)));
1435  }
1436  else if (soap->chunkbuflen)
1437  soap->chunksize = 0;
1438 
1439  ret = soap->buflen - soap->bufidx;
1440 
1441  if (ret)
1442  break;
1443  }
1444  }
1445  else
1446 #endif
1447 
1448  {
1449  soap->bufidx = 0;
1450  soap->buflen = ret = soap->frecv(soap, soap->buf, SOAP_BUFLEN);
1451  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes from socket %d\n", (unsigned int)ret, soap->socket));
1452  DBGMSG(RECV, soap->buf, ret);
1453  }
1454 
1455 #ifndef WITH_LEANER
1456 
1457  if (soap->fpreparerecv && (soap->error = soap->fpreparerecv(soap, soap->buf, ret)))
1458  return soap->error;
1459 
1460 #endif
1461 #ifdef WITH_ZLIB
1462 
1463  if (soap->mode & SOAP_ENC_ZLIB)
1464  {
1465  register int r;
1466  memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
1467  soap->d_stream->next_in = (Byte*)(soap->z_buf + soap->bufidx);
1468  soap->d_stream->avail_in = (unsigned int)ret;
1469  soap->d_stream->next_out = (Byte*)soap->buf;
1470  soap->d_stream->avail_out = SOAP_BUFLEN;
1471  r = inflate(soap->d_stream, Z_NO_FLUSH);
1472 
1473  if (r == Z_OK || r == Z_STREAM_END)
1474  {
1475  soap->bufidx = 0;
1476  soap->z_buflen = soap->buflen;
1477  soap->buflen = SOAP_BUFLEN - soap->d_stream->avail_out;
1478 
1479  if (soap->zlib_in == SOAP_ZLIB_GZIP)
1480  soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)soap->buflen);
1481 
1482  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %u bytes\n", (unsigned int)soap->buflen));
1483 
1484  if (ret && !soap->buflen)
1485  goto zlib_again;
1486 
1487  ret = soap->buflen;
1488 
1489  if (r == Z_STREAM_END)
1490  {
1491  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated total %lu->%lu bytes\n", soap->d_stream->total_in, soap->d_stream->total_out));
1492  soap->z_ratio_in = (float)soap->d_stream->total_in / (float)soap->d_stream->total_out;
1493  soap->d_stream->next_out = Z_NULL;
1494  }
1495 
1496  DBGLOG(RECV, SOAP_MESSAGE(fdebug, "\n---- decompressed ----\n"));
1497  DBGMSG(RECV, soap->buf, ret);
1498  }
1499  else
1500  {
1501  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to inflate: (%d) %s\n", r, soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS));
1502  soap->d_stream->next_out = Z_NULL;
1504  return EOF;
1505  }
1506  }
1507 
1508 #endif
1509  soap->count += ret;
1510  return !ret;
1511  }
size_t(* frecv)(struct soap *, char *, size_t)
Definition: stdsoap2.h:1658
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define DBGMSG(DBGFILE, MSG, LEN)
Definition: stdsoap2.h:1248
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
size_t chunksize
Definition: stdsoap2.h:1732
#define SOAP_IO
Definition: stdsoap2.h:1086
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int32_t z_crc
Definition: stdsoap2.h:1823
size_t z_buflen
Definition: stdsoap2.h:1829
static int soap_isxdigit(int)
Definition: stdsoap2.cpp:1281
#define SOAP_ZLIB_GZIP
Definition: stdsoap2.h:1080
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
soap_wchar ahead
Definition: stdsoap2.h:1701
#define soap_strtoul(s, t, b)
Definition: stdsoap2.h:1925
void * d_stream
Definition: stdsoap2.h:1822
char buf[(65536)]
Definition: stdsoap2.h:1710
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1102
float z_ratio_in
Definition: stdsoap2.h:1831
size_t bufidx
Definition: stdsoap2.h:1699
#define SOAP_OK
Definition: stdsoap2.h:995
static soap_wchar soap_getchunkchar(struct soap *)
Definition: stdsoap2.cpp:1260
short zlib_in
Definition: stdsoap2.h:1826
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
char * z_buf
Definition: stdsoap2.h:1828
int(* fpreparerecv)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1668
size_t chunkbuflen
Definition: stdsoap2.h:1733
#define SOAP_ZLIB_ERROR
Definition: stdsoap2.h:1026
int socket
Definition: stdsoap2.h:1684
int32_t soap_wchar
Definition: stdsoap2.h:1257
size_t buflen
Definition: stdsoap2.h:1700
size_t count
Definition: stdsoap2.h:1705
int soap_reference ( struct soap ,
const void p,
int  t 
)

Definition at line 6688 of file stdsoap2.cpp.

References DBGLOG, soap_plist::mark1, soap_plist::mark2, soap::mode, soap_pointer_enter(), soap_pointer_lookup(), and SOAP_XML_TREE.

Referenced by soap_serialize_PointerToSOAP_ENV__Code(), soap_serialize_PointerToSOAP_ENV__Detail(), soap_serialize_PointerToSOAP_ENV__Reason(), soap_serialize_PointerTostd__string(), and soap_serialize_string().

6689  {
6690  struct soap_plist *pp;
6691 
6692  if (!p || (soap->mode & SOAP_XML_TREE))
6693  return 1;
6694 
6695  if (soap_pointer_lookup(soap, p, t, &pp))
6696  {
6697  if (pp->mark1 == 0)
6698  {
6699  pp->mark1 = 2;
6700  pp->mark2 = 2;
6701  }
6702  }
6703  else if (soap_pointer_enter(soap, p, NULL, 0, t, &pp))
6704  {
6705  pp->mark1 = 0;
6706  pp->mark2 = 0;
6707  }
6708  else
6709  return 1;
6710 
6711  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reference %p type=%d (%d %d)\n", p, t, (int)pp->mark1, (int)pp->mark2));
6712  return pp->mark1;
6713  }
soap_mode mode
Definition: stdsoap2.h:1601
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char mark1
Definition: stdsoap2.h:1301
int soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6306
#define SOAP_XML_TREE
Definition: stdsoap2.h:1110
int soap_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
Definition: stdsoap2.cpp:6336
char mark2
Definition: stdsoap2.h:1302
int soap_register_plugin_arg ( struct soap ,
int(*)(struct soap *, struct soap_plugin *, void *)  fcreate,
void  
)

Definition at line 19445 of file stdsoap2.cpp.

References soap_plugin::data, DBGLOG, soap::error, soap_plugin::fcopy, soap_plugin::fdelete, soap_plugin::id, soap_plugin::next, soap::plugins, SOAP_EOM, SOAP_FREE, SOAP_MALLOC, and SOAP_OK.

19446  {
19447  register struct soap_plugin *p;
19448  register int r;
19449 
19450  if (!(p = (struct soap_plugin*)SOAP_MALLOC(soap, sizeof(struct soap_plugin))))
19451  return soap->error = SOAP_EOM;
19452 
19453  p->id = NULL;
19454  p->data = NULL;
19455  p->fcopy = NULL;
19456  p->fdelete = NULL;
19457  r = fcreate(soap, p, arg);
19458 
19459  if (!r && p->fdelete)
19460  {
19461  p->next = soap->plugins;
19462  soap->plugins = p;
19463  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Registered '%s' plugin\n", p->id));
19464  return SOAP_OK;
19465  }
19466 
19467  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not register plugin '%s': plugin returned error %d (or fdelete callback not set)\n", p->id ? p->id : "?", r));
19468  SOAP_FREE(soap, p);
19469  return r;
19470  }
int error
Definition: stdsoap2.h:1755
struct soap_plugin * plugins
Definition: stdsoap2.h:1635
struct soap_plugin * next
Definition: stdsoap2.h:1880
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
const char * id
Definition: stdsoap2.h:1881
int(* fcopy)(struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src)
Definition: stdsoap2.h:1883
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
#define SOAP_OK
Definition: stdsoap2.h:995
void * data
Definition: stdsoap2.h:1882
void(* fdelete)(struct soap *soap, struct soap_plugin *p)
Definition: stdsoap2.h:1884
#define SOAP_EOM
Definition: stdsoap2.h:1015
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
int soap_resolve ( struct soap )

Definition at line 2910 of file stdsoap2.cpp.

References soap_ilist::copy, DBGLOG, soap::error, soap_flist::fcopy, soap_ilist::flist, soap::id, soap_ilist::id, soap::iht, soap_flist::len, soap_flist::level, soap_ilist::level, soap_ilist::link, soap_flist::next, soap_ilist::next, soap_flist::ptr, soap_ilist::ptr, soap_ilist::size, soap_fcopy(), SOAP_FREE, soap_has_copies(), SOAP_IDHASH, soap_malloc(), SOAP_MISSING_ID, SOAP_OK, soap_flist::type, and soap_ilist::type.

Referenced by soap_end_recv().

2911  {
2912  register int i;
2913  register struct soap_ilist *ip = NULL;
2914  register struct soap_flist *fp = NULL;
2915  short flag;
2916  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded data\n"));
2917 
2918  for (i = 0; i < SOAP_IDHASH; i++)
2919  {
2920  for (ip = soap->iht[i]; ip; ip = ip->next)
2921  {
2922  if (ip->ptr)
2923  {
2924  register void * p, **q, *r;
2925  q = (void**)ip->link;
2926  ip->link = NULL;
2927  r = ip->ptr;
2928 
2929  DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing link chain to resolve id='%s'\n", ip->id));
2930 
2931  while (q)
2932  {
2933  p = *q;
2934  *q = r;
2935  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... link %p -> %p\n", q, r));
2936  q = (void**)p;
2937  }
2938  }
2939  else if (*ip->id == '#')
2940  {
2941  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Missing data for id='%s'\n", ip->id));
2942  strcpy(soap->id, ip->id + 1);
2943  return soap->error = SOAP_MISSING_ID;
2944  }
2945  }
2946  }
2947 
2948  do
2949  {
2950  flag = 0;
2951  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution phase\n"));
2952 
2953  for (i = 0; i < SOAP_IDHASH; i++)
2954  {
2955  for (ip = soap->iht[i]; ip; ip = ip->next)
2956  {
2957  if (ip->ptr && !soap_has_copies(soap, (const char*)ip->ptr, (const char*)ip->ptr + ip->size))
2958  {
2959  if (ip->copy)
2960  {
2961  register void * p, **q = (void**)ip->copy;
2962 
2963  DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing copy chain to resolve id='%s'\n", ip->id));
2964 
2965  ip->copy = NULL;
2966 
2967  do
2968  {
2969  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... copy %p -> %p (%u bytes)\n", ip->ptr, q, (unsigned int)ip->size));
2970  p = *q;
2971  memcpy(q, ip->ptr, ip->size);
2972  q = (void**)p;
2973  }
2974  while (q);
2975 
2976  flag = 1;
2977  }
2978 
2979  for (fp = ip->flist; fp; fp = ip->flist)
2980  {
2981  register unsigned int k = fp->level;
2982  register void *p = ip->ptr;
2983  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded data type=%d location=%p level=%u,%u id='%s'\n", ip->type, p, ip->level, fp->level, ip->id));
2984 
2985  while (ip->level < k)
2986  {
2987  register void **q = (void**)soap_malloc(soap, sizeof(void*));
2988 
2989  if (!q)
2990  return soap->error;
2991 
2992  *q = p;
2993  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level, new location=%p holds=%p...\n", q, *q));
2994  p = (void*)q;
2995  k--;
2996  }
2997 
2998  if (fp->fcopy)
2999  fp->fcopy(soap, ip->type, fp->type, fp->ptr, fp->len, p, ip->size);
3000  else
3001  soap_fcopy(soap, ip->type, fp->type, fp->ptr, fp->len, p, ip->size);
3002 
3003  ip->flist = fp->next;
3004  SOAP_FREE(soap, fp);
3005  flag = 1;
3006  }
3007  }
3008  }
3009  }
3010  }
3011  while (flag);
3012 
3013 #ifdef SOAP_DEBUG
3014 
3015  for (i = 0; i < SOAP_IDHASH; i++)
3016  {
3017  for (ip = soap->iht[i]; ip; ip = ip->next)
3018  {
3019  if (ip->copy || ip->flist)
3020  {
3021  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution error: forwarded data for id='%s' could not be propagated, please report this problem to the developers\n", ip->id));
3022  }
3023  }
3024  }
3025 
3026 #endif
3027  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolution done\n"));
3028  return SOAP_OK;
3029  }
void soap_fcopy(struct soap *soap, int st, int tt, void *p, size_t len, const void *q, size_t n)
Definition: stdsoap2.cpp:7736
int error
Definition: stdsoap2.h:1755
#define SOAP_IDHASH
Definition: stdsoap2.h:834
struct soap_ilist * next
Definition: stdsoap2.h:1867
struct soap_flist * next
Definition: stdsoap2.h:1856
void * link
Definition: stdsoap2.h:1870
char id[1]
Definition: stdsoap2.h:1875
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_MISSING_ID
Definition: stdsoap2.h:1020
unsigned int level
Definition: stdsoap2.h:1874
void * ptr
Definition: stdsoap2.h:1873
size_t len
Definition: stdsoap2.h:1860
unsigned int level
Definition: stdsoap2.h:1859
void(* fcopy)(struct soap *, int, int, void *, size_t, const void *, size_t)
Definition: stdsoap2.h:1861
char id[(1024)]
Definition: stdsoap2.h:1714
struct soap_ilist * iht[(1999)]
Definition: stdsoap2.h:1627
void * ptr
Definition: stdsoap2.h:1858
long int flag
Definition: f2c.h:52
void * copy
Definition: stdsoap2.h:1871
#define SOAP_OK
Definition: stdsoap2.h:995
struct soap_flist * flist
Definition: stdsoap2.h:1872
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
static int soap_has_copies(struct soap *, const char *, const char *)
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
size_t size
Definition: stdsoap2.h:1869
int soap_response ( struct soap ,
int   
)

Definition at line 18661 of file stdsoap2.cpp.

References soap::error, soap::fresponse, if(), soap::mode, soap::omode, soap_begin_send(), soap_count_attachments(), SOAP_ENC_XML, SOAP_ENC_ZLIB, SOAP_FILE, soap_flush(), SOAP_HTML, SOAP_IO, SOAP_IO_BUFFER, SOAP_IO_CHUNK, SOAP_IO_FLUSH, SOAP_IO_STORE, SOAP_OK, and soap::status.

Referenced by soap_send_empty_response(), and soap_send_fault().

18662  {
18663  register size_t count;
18664 
18665  if (!(soap->omode & (SOAP_ENC_XML | SOAP_IO_STORE /* this tests for chunking too */))
18666  && (status == SOAP_HTML || status == SOAP_FILE))
18668 
18669  soap->status = status;
18670  count = soap_count_attachments(soap);
18671 
18672  if (soap_begin_send(soap))
18673  return soap->error;
18674 
18675 #ifndef WITH_NOHTTP
18676 
18677  if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_XML))
18678  {
18679  register int n = soap->mode;
18680  soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB);
18681 
18682  if ((n & SOAP_IO) != SOAP_IO_FLUSH)
18683  soap->mode |= SOAP_IO_BUFFER;
18684 
18685  if ((soap->error = soap->fresponse(soap, status, count)))
18686  return soap->error;
18687 
18688 #ifndef WITH_LEANER
18689 
18690  if ((n & SOAP_IO) == SOAP_IO_CHUNK)
18691  {
18692  if (soap_flush(soap))
18693  return soap->error;
18694  }
18695 
18696 #endif
18697  soap->mode = n;
18698  }
18699 
18700 #endif
18701  return SOAP_OK;
18702  }
#define SOAP_FILE
Definition: stdsoap2.h:1059
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
int soap_begin_send(struct soap *soap)
Definition: stdsoap2.cpp:6521
#define SOAP_IO_FLUSH
Definition: stdsoap2.h:1087
#define SOAP_IO
Definition: stdsoap2.h:1086
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
soap_mode omode
Definition: stdsoap2.h:1603
#define SOAP_IO_BUFFER
Definition: stdsoap2.h:1088
static size_t soap_count_attachments(struct soap *soap)
Definition: stdsoap2.cpp:14338
#define SOAP_ENC_ZLIB
Definition: stdsoap2.h:1102
#define SOAP_OK
Definition: stdsoap2.h:995
int status
Definition: stdsoap2.h:1754
int(* fresponse)(struct soap *, int, size_t)
Definition: stdsoap2.h:1645
#define SOAP_HTML
Definition: stdsoap2.h:1058
#define SOAP_IO_STORE
Definition: stdsoap2.h:1089
#define SOAP_ENC_XML
Definition: stdsoap2.h:1098
if(!yymsg) yymsg
int soap_flush(struct soap *soap)
Definition: stdsoap2.cpp:863
void soap_retry ( struct soap )

Definition at line 10851 of file stdsoap2.cpp.

References soap::error, SOAP_OK, and soap_revert().

10852  {
10853  soap->error = SOAP_OK;
10854  soap_revert(soap);
10855  }
int error
Definition: stdsoap2.h:1755
#define SOAP_OK
Definition: stdsoap2.h:995
void soap_revert(struct soap *soap)
Definition: stdsoap2.cpp:10863
void soap_revert ( struct soap )

Definition at line 10863 of file stdsoap2.cpp.

References soap::body, DBGLOG, soap::level, and soap::peeked.

Referenced by soap_in_PointerToArrayOf_USCORExsd_USCOREstring(), soap_in_PointerToSOAP_ENV__Code(), soap_in_PointerToSOAP_ENV__Detail(), soap_in_PointerToSOAP_ENV__Reason(), soap_in_PointerTostd__string(), soap_inbyte(), soap_indateTime(), soap_inint(), soap_inlong(), soap_inLONG64(), soap_inshort(), soap_inULONG64(), soap_inunsignedByte(), soap_inunsignedInt(), soap_inunsignedLong(), soap_inunsignedShort(), soap_isnumeric(), and soap_retry().

10864  {
10865  if (!soap->peeked)
10866  {
10867  soap->peeked = 1;
10868 
10869  if (soap->body)
10870  soap->level--;
10871  }
10872 
10873  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reverting last element (level=%u)\n", soap->level));
10874  }
unsigned int level
Definition: stdsoap2.h:1704
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
short peeked
Definition: stdsoap2.h:1731
short body
Definition: stdsoap2.h:1703
char* soap_s2base64 ( struct soap ,
const unsigned char *  ,
char *  ,
int   
)

Definition at line 17979 of file stdsoap2.cpp.

References soap_malloc().

Referenced by http_post(), soap_putbase64(), and tcp_connect().

17980  {
17981  register int i;
17982  register unsigned long m;
17983  register char *p;
17984 
17985  if (!t)
17986  t = (char*)soap_malloc(soap, (n + 2) / 3 * 4 + 1);
17987 
17988  if (!t)
17989  return NULL;
17990 
17991  p = t;
17992  t[0] = '\0';
17993 
17994  if (!s)
17995  return p;
17996 
17997  for (; n > 2; n -= 3, s += 3)
17998  {
17999  m = s[0];
18000  m = (m << 8) | s[1];
18001  m = (m << 8) | s[2];
18002 
18003  for (i = 4; i > 0; m >>= 6)
18004  t[--i] = soap_base64o[m & 0x3F];
18005 
18006  t += 4;
18007  }
18008 
18009  t[0] = '\0';
18010 
18011  if (n > 0)
18012  {
18013  m = 0;
18014 
18015  for (i = 0; i < n; i++)
18016  m = (m << 8) | *s++;
18017 
18018  for (; i < 3; i++)
18019  m <<= 8;
18020 
18021  for (i++; i > 0; m >>= 6)
18022  t[--i] = soap_base64o[m & 0x3F];
18023 
18024  for (i = 3; i > n; i--)
18025  t[i] = '=';
18026 
18027  t[4] = '\0';
18028  }
18029 
18030  return p;
18031  }
static const char soap_base64o[65]
Definition: stdsoap2.cpp:293
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
int soap_s2byte ( struct soap ,
const char *  ,
char *   
)

Definition at line 12283 of file stdsoap2.cpp.

References soap::error, soap_strtol, and SOAP_TYPE.

Referenced by soap_inbyte().

12284  {
12285  if (s)
12286  {
12287  long n;
12288  char *r;
12289  n = soap_strtol(s, &r, 10);
12290 
12291  if (s == r || *r || n < -128 || n > 127)
12292  soap->error = SOAP_TYPE;
12293 
12294  *p = (char)n;
12295  }
12296 
12297  return soap->error;
12298  }
int error
Definition: stdsoap2.h:1755
#define soap_strtol(s, t, b)
Definition: stdsoap2.h:1919
#define SOAP_TYPE
Definition: stdsoap2.h:999
int soap_s2dateTime ( struct soap ,
const char *  ,
time_t *   
)

Definition at line 13900 of file stdsoap2.cpp.

References soap::error, soap_timegm(), and SOAP_TYPE.

Referenced by soap_indateTime().

13901  {
13902  if (s)
13903  {
13904  char zone[32];
13905  struct tm T;
13906  const char *t;
13907  *zone = '\0';
13908  memset((void*)&T, 0, sizeof(T));
13909 
13910  if (strchr(s, '-'))
13911  t = "%d-%d-%dT%d:%d:%d%31s";
13912  else if (strchr(s, ':'))
13913  t = "%4d%2d%2dT%d:%d:%d%31s";
13914  else /* parse non-XSD-standard alternative ISO 8601 format */
13915  t = "%4d%2d%2dT%2d%2d%2d%31s";
13916 
13917  if (sscanf(s, t, &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec, zone) < 6)
13918  return soap->error = SOAP_TYPE;
13919 
13920  if (T.tm_year == 1)
13921  T.tm_year = 70;
13922  else
13923  T.tm_year -= 1900;
13924 
13925  T.tm_mon--;
13926 
13927  if (*zone == '.')
13928  {
13929  for (s = zone + 1; *s; s++)
13930  if (*s < '0' || *s > '9')
13931  break;
13932  }
13933  else
13934  s = zone;
13935 
13936  if (*s)
13937  {
13938 #ifndef WITH_NOZONE
13939 
13940  if (*s == '+' || *s == '-')
13941  {
13942  int h = 0, m = 0;
13943 
13944  if (s[3] == ':')
13945  {/* +hh:mm */
13946  sscanf(s, "%d:%d", &h, &m);
13947 
13948  if (h < 0)
13949  m = -m;
13950  }
13951  else /* +hhmm */
13952  {
13953  m = (int)atol(s);
13954  h = m / 100;
13955  m = m % 100;
13956  }
13957 
13958  T.tm_min -= m;
13959  T.tm_hour -= h;
13960  /* put hour and min in range */
13961  T.tm_hour += T.tm_min / 60;
13962  T.tm_min %= 60;
13963 
13964  if (T.tm_min < 0)
13965  T.tm_min += 60;
13966 
13967  T.tm_mday += T.tm_hour / 24;
13968  T.tm_hour %= 24;
13969 
13970  if (T.tm_hour < 0)
13971  T.tm_hour += 24;
13972 
13973  /* note: day of the month may be out of range, timegm() handles it */
13974  }
13975 
13976 #endif
13977  *p = soap_timegm(&T);
13978  }
13979  else
13980  *p = mktime(&T);
13981  }
13982 
13983  return soap->error;
13984  }
int error
Definition: stdsoap2.h:1755
time_t soap_timegm(struct tm *T)
Definition: stdsoap2.cpp:13761
#define SOAP_TYPE
Definition: stdsoap2.h:999
int soap_s2double ( struct soap ,
const char *  ,
double *   
)

Definition at line 12663 of file stdsoap2.cpp.

References soap::c_locale, DBL_NAN, DBL_NINFTY, DBL_PINFTY, soap::error, soap_tag_cmp(), and SOAP_TYPE.

Referenced by soap_indouble().

12664  {
12665  if (s)
12666  {
12667  if (!*s)
12668  return soap->error = SOAP_TYPE;
12669 
12670  if (!soap_tag_cmp(s, "INF"))
12671  *p = DBL_PINFTY;
12672  else if (!soap_tag_cmp(s, "+INF"))
12673  *p = DBL_PINFTY;
12674  else if (!soap_tag_cmp(s, "-INF"))
12675  *p = DBL_NINFTY;
12676  else if (!soap_tag_cmp(s, "NaN"))
12677  *p = DBL_NAN;
12678  else
12679  {
12680 #if defined(HAVE_STRTOD_L)
12681  char *r;
12682  *p = strtod_l(s, &r, soap->c_locale);
12683 
12684  if (*r)
12685 #elif defined(HAVE_STRTOD)
12686  char *r;
12687 
12688  *p = strtod(s, &r);
12689 
12690  if (*r)
12691 #endif
12692  {
12693 #if defined(HAVE_SSCANF_L) && !defined(HAVE_STRTOF_L) && !defined(HAVE_STRTOD_L)
12694 
12695  if (sscanf_l(s, soap->c_locale, "%lg", p) != 1)
12696  soap->error = SOAP_TYPE;
12697 
12698 #elif defined(HAVE_SSCANF)
12699 
12700  if (sscanf(s, "%lg", p) != 1)
12701  soap->error = SOAP_TYPE;
12702 
12703 #else
12704  soap->error = SOAP_TYPE;
12705 #endif
12706  }
12707  }
12708  }
12709 
12710  return soap->error;
12711  }
#define DBL_PINFTY
Definition: stdsoap2.h:970
int error
Definition: stdsoap2.h:1755
int soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:3657
#define SOAP_TYPE
Definition: stdsoap2.h:999
void * c_locale
Definition: stdsoap2.h:1816
#define DBL_NINFTY
Definition: stdsoap2.h:975
#define DBL_NAN
Definition: stdsoap2.h:957
int soap_s2float ( struct soap ,
const char *  ,
float *   
)

Definition at line 12482 of file stdsoap2.cpp.

References soap::c_locale, soap::error, FLT_NAN, FLT_NINFTY, FLT_PINFTY, soap_tag_cmp(), and SOAP_TYPE.

Referenced by soap_infloat().

12483  {
12484  if (s)
12485  {
12486  if (!*s)
12487  return soap->error = SOAP_TYPE;
12488 
12489  if (!soap_tag_cmp(s, "INF"))
12490  *p = FLT_PINFTY;
12491  else if (!soap_tag_cmp(s, "+INF"))
12492  *p = FLT_PINFTY;
12493  else if (!soap_tag_cmp(s, "-INF"))
12494  *p = FLT_NINFTY;
12495  else if (!soap_tag_cmp(s, "NaN"))
12496  *p = FLT_NAN;
12497  else
12498  {
12499  /* On some systems strtof requires -std=c99 or does not even link: so we try to use strtod first */
12500 #if defined(HAVE_STRTOD_L)
12501  char *r;
12502  *p = (float)strtod_l(s, &r, soap->c_locale);
12503 
12504  if (*r)
12505 #elif defined(HAVE_STRTOD)
12506  char *r;
12507 
12508  *p = (float)strtod(s, &r);
12509 
12510  if (*r)
12511 #elif defined(HAVE_STRTOF_L)
12512  char *r;
12513 
12514  *p = strtof_l((char*)s, &r, soap->c_locale);
12515 
12516  if (*r)
12517 #elif defined(HAVE_STRTOF)
12518  char *r;
12519 
12520  *p = strtof((char*)s, &r);
12521 
12522  if (*r)
12523 #endif
12524  {
12525 #if defined(HAVE_SSCANF_L) && !defined(HAVE_STRTOF_L) && !defined(HAVE_STRTOD_L)
12526 
12527  if (sscanf_l(s, soap->c_locale, "%g", p) != 1)
12528  soap->error = SOAP_TYPE;
12529 
12530 #elif defined(HAVE_SSCANF)
12531 
12532  if (sscanf(s, "%g", p) != 1)
12533  soap->error = SOAP_TYPE;
12534 
12535 #else
12536  soap->error = SOAP_TYPE;
12537 #endif
12538  }
12539  }
12540  }
12541 
12542  return soap->error;
12543  }
int error
Definition: stdsoap2.h:1755
int soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:3657
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define FLT_NINFTY
Definition: stdsoap2.h:953
void * c_locale
Definition: stdsoap2.h:1816
#define FLT_NAN
Definition: stdsoap2.h:935
#define FLT_PINFTY
Definition: stdsoap2.h:948
char* soap_s2hex ( struct soap ,
const unsigned char *  ,
char *  ,
int   
)

Definition at line 18151 of file stdsoap2.cpp.

References soap_malloc().

Referenced by soap_puthex().

18152  {
18153  register char *p;
18154 
18155  if (!t)
18156  t = (char*)soap_malloc(soap, 2 * n + 1);
18157 
18158  if (!t)
18159  return NULL;
18160 
18161  p = t;
18162  t[0] = '\0';
18163 
18164  if (s)
18165  {
18166  for (; n > 0; n--)
18167  {
18168  register int m = *s++;
18169  *t++ = (char)((m >> 4) + (m > 159 ? 'a' - 10 : '0'));
18170  m &= 0x0F;
18171  *t++ = (char)(m + (m > 9 ? 'a' - 10 : '0'));
18172  }
18173  }
18174 
18175  *t++ = '\0';
18176  return p;
18177  }
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
int soap_s2int ( struct soap ,
const char *  ,
int *   
)

Definition at line 11975 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_ERANGE, soap_errno, soap_reset_errno, soap_strtol, SOAP_TYPE, and SOAP_XML_STRICT.

Referenced by soap_inint().

11976  {
11977  if (s)
11978  {
11979  char *r;
11980 #ifndef WITH_NOIO
11981 #ifndef WITH_LEAN
11983 #endif
11984 #endif
11985  *p = (int)soap_strtol(s, &r, 10);
11986 
11987  if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
11988 #ifndef WITH_NOIO
11989 #ifndef WITH_LEAN
11990  || soap_errno == SOAP_ERANGE
11991 #endif
11992 #endif
11993  )
11994  soap->error = SOAP_TYPE;
11995  }
11996 
11997  return soap->error;
11998  }
#define soap_errno
Definition: stdsoap2.h:802
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define soap_strtol(s, t, b)
Definition: stdsoap2.h:1919
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
#define SOAP_ERANGE
Definition: stdsoap2.h:777
#define soap_reset_errno
Definition: stdsoap2.h:804
int soap_s2long ( struct soap ,
const char *  ,
long *   
)

Definition at line 12074 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_ERANGE, soap_errno, soap_reset_errno, soap_strtol, SOAP_TYPE, and SOAP_XML_STRICT.

Referenced by soap_inlong().

12075  {
12076  if (s)
12077  {
12078  char *r;
12079 #ifndef WITH_NOIO
12080 #ifndef WITH_LEAN
12082 #endif
12083 #endif
12084  *p = soap_strtol(s, &r, 10);
12085 
12086  if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
12087 #ifndef WITH_NOIO
12088 #ifndef WITH_LEAN
12089  || soap_errno == SOAP_ERANGE
12090 #endif
12091 #endif
12092  )
12093  soap->error = SOAP_TYPE;
12094  }
12095 
12096  return soap->error;
12097  }
#define soap_errno
Definition: stdsoap2.h:802
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define soap_strtol(s, t, b)
Definition: stdsoap2.h:1919
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
#define SOAP_ERANGE
Definition: stdsoap2.h:777
#define soap_reset_errno
Definition: stdsoap2.h:804
int soap_s2LONG64 ( struct soap ,
const char *  ,
long long *   
)

Definition at line 12173 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_ERANGE, soap_errno, SOAP_LONG_FORMAT, soap_reset_errno, SOAP_TYPE, and SOAP_XML_STRICT.

Referenced by soap_inLONG64().

12174  {
12175  if (s)
12176  {
12177 #ifdef HAVE_STRTOLL
12178  char *r;
12179 #ifndef WITH_NOIO
12180 #ifndef WITH_LEAN
12182 #endif
12183 #endif
12184  *p = strtoll(s, &r, 10);
12185 
12186  if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
12187 #ifndef WITH_NOIO
12188 #ifndef WITH_LEAN
12189  || soap_errno == SOAP_ERANGE
12190 #endif
12191 #endif
12192  )
12193 #else
12194 # ifdef HAVE_SSCANF
12195  if (sscanf(s, SOAP_LONG_FORMAT, p) != 1)
12196 # endif
12197 #endif
12198  soap->error = SOAP_TYPE;
12199  }
12200 
12201  return soap->error;
12202  }
#define soap_errno
Definition: stdsoap2.h:802
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
#define SOAP_ERANGE
Definition: stdsoap2.h:777
#define soap_reset_errno
Definition: stdsoap2.h:804
#define SOAP_LONG_FORMAT
Definition: stdsoap2.h:746
int soap_s2QName ( struct soap ,
const char *  ,
char **   
)

Definition at line 13252 of file stdsoap2.cpp.

References DBGLOG, soap::error, Namespace::id, soap_nlist::id, soap_nlist::index, soap::labbuf, soap::labidx, soap::local_namespaces, soap_nlist::next, soap::nlist, soap_nlist::ns, soap_append_lab(), soap_blank, SOAP_NAMESPACE, SOAP_STR_EOS, and soap_strdup().

Referenced by soap_string_in().

13253  {
13254  if (s)
13255  {
13256  soap->labidx = 0;
13257  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Normalized namespace(s) of QNames '%s'", s));
13258 
13259  /* convert (by prefix normalize prefix) all QNames in s */
13260  for (;;)
13261  {
13262  size_t n;
13263  struct soap_nlist *np;
13264  register const char *p;
13265 
13266  /* skip blanks */
13267  while (*s && soap_blank(*s))
13268  s++;
13269 
13270  if (!*s)
13271  break;
13272 
13273  /* find next QName */
13274  n = 1;
13275 
13276  while (s[n] && !soap_blank(s[n]))
13277  n++;
13278 
13279  np = soap->nlist;
13280 
13281  /* if there is no namespace stack, or prefix is "xml" then copy string */
13282  if (!np || !strncmp(s, "xml:", 4))
13283  {
13284  soap_append_lab(soap, s, n);
13285  }
13286  else /* we normalize the QName by replacing its prefix */
13287  {
13288  p = strchr(s, ':');
13289 
13290  if (p)
13291  {
13292  size_t k = p - s;
13293 
13294  while (np && (strncmp(np->id, s, k) || np->id[k]))
13295  np = np->next;
13296 
13297  p++;
13298  }
13299  else
13300  {
13301  while (np && *np->id)
13302  np = np->next;
13303 
13304  p = s;
13305  }
13306 
13307  /* replace prefix */
13308  if (np)
13309  {
13310  if (np->index >= 0 && soap->local_namespaces)
13311  {
13312  const char *q = soap->local_namespaces[np->index].id;
13313 
13314  if (q)
13315  soap_append_lab(soap, q, strlen(q));
13316  }
13317  else if (np->ns)
13318  {
13319  soap_append_lab(soap, "\"", 1);
13320  soap_append_lab(soap, np->ns, strlen(np->ns));
13321  soap_append_lab(soap, "\"", 1);
13322  }
13323  else
13324  {
13325  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "\nNamespace prefix of '%s' not defined (index=%d, URI=%s)\n", s, np->index, np->ns ? np->ns : SOAP_STR_EOS));
13326  return soap->error = SOAP_NAMESPACE;
13327  }
13328  }
13329  else /* no namespace: assume default "" namespace */
13330  {
13331  soap_append_lab(soap, "\"\"", 2);
13332  }
13333 
13334  soap_append_lab(soap, ":", 1);
13335  soap_append_lab(soap, p, n - (p - s));
13336  }
13337 
13338  /* advance to next and add spacing */
13339  s += n;
13340 
13341  if (*s)
13342  soap_append_lab(soap, " ", 1);
13343  }
13344 
13346  *t = soap_strdup(soap, soap->labbuf);
13347  DBGLOG(TEST, SOAP_MESSAGE(fdebug, " into '%s'\n", *t));
13348  }
13349 
13350  return soap->error;
13351  }
int error
Definition: stdsoap2.h:1755
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char id[1]
Definition: stdsoap2.h:1275
char * ns
Definition: stdsoap2.h:1274
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
#define soap_blank(c)
Definition: stdsoap2.cpp:118
short index
Definition: stdsoap2.h:1273
struct soap_nlist * next
Definition: stdsoap2.h:1271
size_t labidx
Definition: stdsoap2.h:1709
char * labbuf
Definition: stdsoap2.h:1707
int soap_append_lab(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:10289
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
#define SOAP_NAMESPACE
Definition: stdsoap2.h:1004
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
const char * id
Definition: stdsoap2.h:1262
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
int soap_s2short ( struct soap ,
const char *  ,
short *   
)

Definition at line 12371 of file stdsoap2.cpp.

References soap::error, soap_strtol, and SOAP_TYPE.

Referenced by soap_inshort().

12372  {
12373  if (s)
12374  {
12375  long n;
12376  char *r;
12377  n = soap_strtol(s, &r, 10);
12378 
12379  if (s == r || *r || n < -32768 || n > 32767)
12380  soap->error = SOAP_TYPE;
12381 
12382  *p = (short)n;
12383  }
12384 
12385  return soap->error;
12386  }
int error
Definition: stdsoap2.h:1755
#define soap_strtol(s, t, b)
Definition: stdsoap2.h:1919
#define SOAP_TYPE
Definition: stdsoap2.h:999
int soap_s2string ( struct soap ,
const char *  ,
char **   
)

Definition at line 13231 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_C_UTFSTRING, SOAP_ENC_LATIN, SOAP_EOM, and soap_strdup().

13232  {
13233  if (s)
13234  {
13235  if (!(*t = soap_strdup(soap, s)))
13236  return soap->error = SOAP_EOM;
13237 
13238  if (!(soap->mode & (SOAP_ENC_LATIN | SOAP_C_UTFSTRING)))
13239  {/* TODO: consider truncating UTF8 to ASCII for regular XML attribute strings? */
13240  }
13241  }
13242 
13243  return soap->error;
13244  }
int error
Definition: stdsoap2.h:1755
#define SOAP_C_UTFSTRING
Definition: stdsoap2.h:1117
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_ENC_LATIN
Definition: stdsoap2.h:1097
#define SOAP_EOM
Definition: stdsoap2.h:1015
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
int soap_s2ULONG64 ( struct soap ,
const char *  ,
unsigned long long *   
)

Definition at line 13153 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_ERANGE, soap_errno, soap_reset_errno, SOAP_TYPE, SOAP_ULONG_FORMAT, and SOAP_XML_STRICT.

Referenced by soap_inULONG64().

13154  {
13155  if (s)
13156  {
13157 #ifdef HAVE_STRTOULL
13158  char *r;
13159 #ifndef WITH_NOIO
13160 #ifndef WITH_LEAN
13162 #endif
13163 #endif
13164  *p = strtoull(s, &r, 10);
13165 
13166  if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
13167 #ifndef WITH_NOIO
13168 #ifndef WITH_LEAN
13169  || soap_errno == SOAP_ERANGE
13170 #endif
13171 #endif
13172  )
13173 #else
13174 #ifdef HAVE_SSCANF
13175  if (sscanf(s, SOAP_ULONG_FORMAT, p) != 1)
13176 #endif
13177 #endif
13178  soap->error = SOAP_TYPE;
13179  }
13180 
13181  return soap->error;
13182  }
#define SOAP_ULONG_FORMAT
Definition: stdsoap2.h:750
#define soap_errno
Definition: stdsoap2.h:802
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
#define SOAP_ERANGE
Definition: stdsoap2.h:777
#define soap_reset_errno
Definition: stdsoap2.h:804
int soap_s2unsignedByte ( struct soap ,
const char *  ,
unsigned char *   
)

Definition at line 12778 of file stdsoap2.cpp.

References soap::error, soap_strtoul, and SOAP_TYPE.

Referenced by soap_inunsignedByte().

12779  {
12780  if (s)
12781  {
12782  unsigned long n;
12783  char *r;
12784  n = soap_strtoul(s, &r, 10);
12785 
12786  if (s == r || *r || n > 255)
12787  soap->error = SOAP_TYPE;
12788 
12789  *p = (unsigned char)n;
12790  }
12791 
12792  return soap->error;
12793  }
int error
Definition: stdsoap2.h:1755
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define soap_strtoul(s, t, b)
Definition: stdsoap2.h:1925
int soap_s2unsignedInt ( struct soap ,
const char *  ,
unsigned int *   
)

Definition at line 12955 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_ERANGE, soap_errno, soap_reset_errno, soap_strtoul, SOAP_TYPE, and SOAP_XML_STRICT.

Referenced by soap_inunsignedInt().

12956  {
12957  if (s)
12958  {
12959  char *r;
12960 #ifndef WITH_NOIO
12961 #ifndef WITH_LEAN
12963 #endif
12964 #endif
12965  *p = (unsigned int)soap_strtoul(s, &r, 10);
12966 
12967  if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
12968 #ifndef WITH_NOIO
12969 #ifndef WITH_LEAN
12970  || soap_errno == SOAP_ERANGE
12971 #endif
12972 #endif
12973  )
12974  soap->error = SOAP_TYPE;
12975  }
12976 
12977  return soap->error;
12978  }
#define soap_errno
Definition: stdsoap2.h:802
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define soap_strtoul(s, t, b)
Definition: stdsoap2.h:1925
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
#define SOAP_ERANGE
Definition: stdsoap2.h:777
#define soap_reset_errno
Definition: stdsoap2.h:804
int soap_s2unsignedLong ( struct soap ,
const char *  ,
unsigned long *   
)

Definition at line 13054 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_ERANGE, soap_errno, soap_reset_errno, soap_strtoul, SOAP_TYPE, and SOAP_XML_STRICT.

Referenced by soap_inunsignedLong().

13055  {
13056  if (s)
13057  {
13058  char *r;
13059 #ifndef WITH_NOIO
13060 #ifndef WITH_LEAN
13062 #endif
13063 #endif
13064  *p = soap_strtoul(s, &r, 10);
13065 
13066  if ((s == r && (soap->mode & SOAP_XML_STRICT)) || *r
13067 #ifndef WITH_NOIO
13068 #ifndef WITH_LEAN
13069  || soap_errno == SOAP_ERANGE
13070 #endif
13071 #endif
13072  )
13073  soap->error = SOAP_TYPE;
13074  }
13075 
13076  return soap->error;
13077  }
#define soap_errno
Definition: stdsoap2.h:802
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define soap_strtoul(s, t, b)
Definition: stdsoap2.h:1925
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
#define SOAP_ERANGE
Definition: stdsoap2.h:777
#define soap_reset_errno
Definition: stdsoap2.h:804
int soap_s2unsignedShort ( struct soap ,
const char *  ,
unsigned short *   
)

Definition at line 12866 of file stdsoap2.cpp.

References soap::error, soap_strtoul, and SOAP_TYPE.

Referenced by soap_inunsignedShort().

12867  {
12868  if (s)
12869  {
12870  unsigned long n;
12871  char *r;
12872  n = soap_strtoul(s, &r, 10);
12873 
12874  if (s == r || *r || n > 65535)
12875  soap->error = SOAP_TYPE;
12876 
12877  *p = (unsigned short)n;
12878  }
12879 
12880  return soap->error;
12881  }
int error
Definition: stdsoap2.h:1755
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define soap_strtoul(s, t, b)
Definition: stdsoap2.h:1925
int soap_s2wchar ( struct soap ,
const char *  ,
wchar_t **   
)

Definition at line 13462 of file stdsoap2.cpp.

References soap::error, soap::mode, SOAP_ENC_LATIN, soap_malloc(), and SOAP_OK.

13463  {
13464  if (s)
13465  {
13466  wchar_t *r;
13467  *t = r = (wchar_t*)soap_malloc(soap, sizeof(wchar_t) * (strlen(s) + 1));
13468 
13469  if (!r)
13470  return soap->error;
13471 
13472  if (soap->mode & SOAP_ENC_LATIN)
13473  {
13474  while (*s)
13475  *r++ = (wchar_t) * s++;
13476  }
13477  else
13478  {/* Convert UTF8 to wchar */
13479  while (*s)
13480  {
13481  register soap_wchar c, c1, c2, c3, c4;
13482  c = (unsigned char) * s++;
13483 
13484  if (c < 0x80)
13485  *r++ = (wchar_t)c;
13486  else
13487  {
13488  c1 = (soap_wchar) * s++ & 0x3F;
13489 
13490  if (c < 0xE0)
13491  *r++ = (wchar_t)(((soap_wchar)(c & 0x1F) << 6) | c1);
13492  else
13493  {
13494  c2 = (soap_wchar) * s++ & 0x3F;
13495 
13496  if (c < 0xF0)
13497  *r++ = (wchar_t)(((soap_wchar)(c & 0x0F) << 12) | (c1 << 6) | c2);
13498  else
13499  {
13500  c3 = (soap_wchar) * s++ & 0x3F;
13501 
13502  if (c < 0xF8)
13503  *r++ = (wchar_t)(((soap_wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3);
13504  else
13505  {
13506  c4 = (soap_wchar) * s++ & 0x3F;
13507 
13508  if (c < 0xFC)
13509  *r++ = (wchar_t)(((soap_wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4);
13510  else
13511  *r++ = (wchar_t)(((soap_wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (soap_wchar)(*s++ & 0x3F));
13512  }
13513  }
13514  }
13515  }
13516  }
13517  }
13518 
13519  *r = L'\0';
13520  }
13521 
13522  return SOAP_OK;
13523  }
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_ENC_LATIN
Definition: stdsoap2.h:1097
int32_t soap_wchar
Definition: stdsoap2.h:1257
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
char* soap_save_block ( struct soap ,
struct soap_blist ,
char *  ,
int   
)

Definition at line 3179 of file stdsoap2.cpp.

References soap::blist, DBGLOG, soap::error, soap_blist::ptr, soap_blist::size, soap_block_size(), soap_end_block(), SOAP_EOM, soap_first_block(), soap_malloc(), soap_next_block(), and soap_update_ptrs().

Referenced by soap_get_http_body(), soap_get_mime_attachment(), soap_getbase64(), soap_getdime(), soap_gethex(), soap_in_ArrayOf_USCORExsd_USCOREstring(), soap_peek_element(), soap_string_in(), and soap_wstring_in().

3180  {
3181  register size_t n;
3182  register char *q, *s;
3183 
3184  if (!b)
3185  b = soap->blist;
3186 
3187  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Save all blocks in contiguous memory space of %u bytes (%p->%p)\n", (unsigned int)b->size, b->ptr, p));
3188 
3189  if (b->size)
3190  {
3191  if (!p)
3192  p = (char*)soap_malloc(soap, b->size);
3193 
3194  if (p)
3195  {
3196  for (s = p, q = soap_first_block(soap, b); q; q = soap_next_block(soap, b))
3197  {
3198  n = soap_block_size(soap, b);
3199 #ifndef WITH_NOIDREF
3200 
3201  if (flag)
3202  soap_update_ptrs(soap, q, q + n, s, q);
3203 
3204 #endif
3205  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy %u bytes from %p to %p\n", (unsigned int)n, q, s));
3206  memcpy(s, q, n);
3207  s += n;
3208  }
3209  }
3210  else
3211  soap->error = SOAP_EOM;
3212  }
3213 
3214  soap_end_block(soap, b);
3215  return p;
3216  }
struct soap_blist * blist
Definition: stdsoap2.h:1624
char * soap_next_block(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3092
int error
Definition: stdsoap2.h:1755
size_t soap_block_size(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3120
static void soap_update_ptrs(struct soap *, char *, char *, char *, char *)
Definition: stdsoap2.cpp:2802
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
char * soap_first_block(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3058
long int flag
Definition: f2c.h:52
#define SOAP_EOM
Definition: stdsoap2.h:1015
void soap_end_block(struct soap *soap, struct soap_blist *b)
Definition: stdsoap2.cpp:3134
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
int soap_send ( struct soap ,
const char *   
)

Definition at line 959 of file stdsoap2.cpp.

References SOAP_OK, and soap_send_raw().

Referenced by soap_attribute(), soap_element(), soap_element_end_out(), soap_element_start_end_out(), soap_outliteral(), soap_outwliteral(), soap_pututf8(), soap_send2(), soap_send3(), and soap_wstring_out().

960  {
961  if (s)
962  return soap_send_raw(soap, s, strlen(s));
963 
964  return SOAP_OK;
965  }
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_send2 ( struct soap ,
const char *  ,
const char *   
)

Definition at line 974 of file stdsoap2.cpp.

References soap::error, and soap_send().

975  {
976  if (soap_send(soap, s1))
977  return soap->error;
978 
979  return soap_send(soap, s2);
980  }
int error
Definition: stdsoap2.h:1755
int soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:959
int soap_send3 ( struct soap ,
const char *  ,
const char *  ,
const char *   
)

Definition at line 990 of file stdsoap2.cpp.

References soap::error, and soap_send().

Referenced by soap_putmime(), and soap_putmimehdr().

991  {
992  if (soap_send(soap, s1)
993  || soap_send(soap, s2))
994  return soap->error;
995 
996  return soap_send(soap, s3);
997  }
int error
Definition: stdsoap2.h:1755
int soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:959
int soap_send_empty_response ( struct soap ,
int  status 
)

Definition at line 19087 of file stdsoap2.cpp.

References soap::count, soap::omode, soap_closesock(), soap_end_send(), SOAP_IO, SOAP_IO_BUFFER, SOAP_IO_CHUNK, SOAP_OK, and soap_response().

19088  {
19089  register soap_mode m = soap->omode;
19090  soap->count = 0;
19091 
19092  if ((m & SOAP_IO) == SOAP_IO_CHUNK)
19093  soap->omode = (m & ~SOAP_IO) | SOAP_IO_BUFFER;
19094 
19095  if (soap_response(soap, httpstatuscode) || soap_end_send(soap))
19096  {
19097  soap->omode = m;
19098  return soap_closesock(soap);
19099  }
19100 
19101  soap->omode = m;
19102  return SOAP_OK;
19103  }
#define SOAP_IO
Definition: stdsoap2.h:1086
#define SOAP_IO_CHUNK
Definition: stdsoap2.h:1090
int32_t soap_mode
Definition: stdsoap2.h:1084
soap_mode omode
Definition: stdsoap2.h:1603
#define SOAP_IO_BUFFER
Definition: stdsoap2.h:1088
int soap_end_send(struct soap *soap)
Definition: stdsoap2.cpp:7748
int soap_closesock(struct soap *soap)
Definition: stdsoap2.cpp:6121
#define SOAP_OK
Definition: stdsoap2.h:995
int soap_response(struct soap *soap, int status)
Definition: stdsoap2.cpp:18661
size_t count
Definition: stdsoap2.h:1705
int soap_send_fault ( struct soap )

Definition at line 18952 of file stdsoap2.cpp.

References DBGLOG, soap::error, soap::fpoll, soap::keep_alive, soap::mode, soap::recv_timeout, soap::send_timeout, soap_begin_count(), soap_body_begin_out(), soap_body_end_out(), soap_closesock(), soap_end_count(), soap_end_send(), soap_envelope_begin_out(), soap_envelope_end_out(), SOAP_EOF, SOAP_IO_LENGTH, SOAP_OK, soap_putfault(), soap_putheader(), soap_response(), soap_serializefault(), soap_serializeheader(), soap_set_fault(), SOAP_STOP, soap_valid_socket, soap::socket, and soap::tmpbuf.

18953  {
18954  register int status = soap->error;
18955 
18956  if (status == SOAP_STOP)
18957  return status;
18958 
18959  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending back fault struct for error code %d\n", soap->error));
18960  soap->keep_alive = 0; /* to terminate connection */
18962 
18963  if (status != SOAP_EOF || (!soap->recv_timeout && !soap->send_timeout))
18964  {
18965  int r = 1;
18966 #ifndef WITH_NOIO
18967 
18968  if (soap->fpoll && soap->fpoll(soap))
18969  r = 0;
18970 
18971 #ifndef WITH_LEAN
18972  else if (soap_valid_socket(soap->socket))
18973  {
18974  struct timeval timeout;
18975  fd_set rfd, sfd;
18976  timeout.tv_sec = 0;
18977  timeout.tv_usec = 0;
18978  FD_ZERO(&rfd);
18979  FD_ZERO(&sfd);
18980  FD_SET(soap->socket, &rfd);
18981  FD_SET(soap->socket, &sfd);
18982  r = select((int)soap->socket + 1, &rfd, &sfd, NULL, &timeout);
18983 
18984  if (r > 0)
18985  {
18986  if (!FD_ISSET(soap->socket, &sfd)
18987  || (FD_ISSET(soap->socket, &rfd)
18988  && recv(soap->socket, soap->tmpbuf, 1, MSG_PEEK) < 0))
18989  r = 0;
18990  }
18991  }
18992 
18993 #endif
18994 #endif
18995 
18996  if (r > 0)
18997  {
18998  soap->error = SOAP_OK;
19002 
19003  if (soap->mode & SOAP_IO_LENGTH)
19004  {
19011  }
19012 
19014 
19015  if (soap_response(soap, status)
19017  || soap_putheader(soap)
19019  || soap_putfault(soap)
19022  return soap_closesock(soap);
19023 
19025  }
19026  }
19027 
19028  soap->error = status;
19029  return soap_closesock(soap);
19030  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
void soap_serializefault(struct soap *soap)
Definition: soapC.cpp:90
int soap_body_begin_out(struct soap *soap)
Definition: stdsoap2.cpp:17644
short keep_alive
Definition: stdsoap2.h:1742
int error
Definition: stdsoap2.h:1755
#define soap_valid_socket(n)
Definition: stdsoap2.h:698
soap_mode mode
Definition: stdsoap2.h:1601
void soap_set_fault(struct soap *soap)
Definition: stdsoap2.cpp:18724
int soap_envelope_begin_out(struct soap *soap)
Definition: stdsoap2.cpp:17406
int soap_putheader(struct soap *soap)
Definition: soapC.cpp:33
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
int(* fpoll)(struct soap *)
Definition: stdsoap2.h:1659
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
#define SOAP_STOP
Definition: stdsoap2.h:1056
int soap_body_end_out(struct soap *soap)
Definition: stdsoap2.cpp:17670
int send_timeout
Definition: stdsoap2.h:1613
int soap_begin_count(struct soap *soap)
Definition: stdsoap2.cpp:6421
int recv_timeout
Definition: stdsoap2.h:1612
int soap_end_send(struct soap *soap)
Definition: stdsoap2.cpp:7748
int soap_closesock(struct soap *soap)
Definition: stdsoap2.cpp:6121
int soap_putfault(struct soap *soap)
Definition: soapC.cpp:98
#define SOAP_OK
Definition: stdsoap2.h:995
void soap_serializeheader(struct soap *soap)
Definition: soapC.cpp:27
int soap_end_count(struct soap *soap)
Definition: stdsoap2.cpp:6503
int soap_response(struct soap *soap, int status)
Definition: stdsoap2.cpp:18661
#define SOAP_EOF
Definition: stdsoap2.h:993
int socket
Definition: stdsoap2.h:1684
int soap_envelope_end_out(struct soap *soap)
Definition: stdsoap2.cpp:17456
int soap_send_raw ( struct soap ,
const char *  ,
size_t   
)

Definition at line 815 of file stdsoap2.cpp.

References soap::buf, soap::bufidx, soap::count, soap::error, soap::fpreparesend, soap::mode, SOAP_BUFLEN, soap_flush(), soap_flush_raw(), SOAP_IO, SOAP_IO_LENGTH, SOAP_IO_STORE, and SOAP_OK.

Referenced by http_post_header(), http_send_header(), soap_attribute(), soap_element(), soap_element_end_out(), soap_element_start_end_out(), soap_envelope_begin_out(), soap_envelope_end_out(), soap_putbase64(), soap_putdime(), soap_putdimefield(), soap_putdimehdr(), soap_puthex(), soap_putmime(), soap_putmimehdr(), soap_pututf8(), soap_send(), soap_string_out(), and soap_wstring_out().

816  {
817  if (!n)
818  return SOAP_OK;
819 
820  if (soap->mode & SOAP_IO_LENGTH)
821  {
822  soap->count += n;
823 #ifndef WITH_LEANER
824 
826  return soap->error = soap->fpreparesend(soap, s, n);
827 
828 #endif
829  return SOAP_OK;
830  }
831 
832  if (soap->mode & SOAP_IO)
833  {
834  register size_t i = SOAP_BUFLEN - soap->bufidx;
835 
836  while (n >= i)
837  {
838  memcpy(soap->buf + soap->bufidx, s, i);
840 
841  if (soap_flush(soap))
842  return soap->error;
843 
844  s += i;
845  n -= i;
846  i = SOAP_BUFLEN;
847  }
848 
849  memcpy(soap->buf + soap->bufidx, s, n);
850  soap->bufidx += n;
851  return SOAP_OK;
852  }
853 
854  return soap_flush_raw(soap, s, n);
855  }
int error
Definition: stdsoap2.h:1755
int soap_flush_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:915
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_BUFLEN
Definition: stdsoap2.h:814
#define SOAP_IO
Definition: stdsoap2.h:1086
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
char buf[(65536)]
Definition: stdsoap2.h:1710
int(* fpreparesend)(struct soap *, const char *, size_t)
Definition: stdsoap2.h:1667
size_t bufidx
Definition: stdsoap2.h:1699
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_IO_STORE
Definition: stdsoap2.h:1089
int soap_flush(struct soap *soap)
Definition: stdsoap2.cpp:863
size_t count
Definition: stdsoap2.h:1705
int soap_sender_fault ( struct soap ,
const char *  ,
const char *   
)

Definition at line 19249 of file stdsoap2.cpp.

References soap_sender_fault_subcode().

19250  {
19251  return soap_sender_fault_subcode(soap, NULL, faultstring, faultdetailXML);
19252  }
int soap_sender_fault_subcode(struct soap *soap, const char *faultsubcodeQName, const char *faultstring, const char *faultdetailXML)
Definition: stdsoap2.cpp:19260
int soap_sender_fault_subcode ( struct soap ,
const char *  ,
const char *  ,
const char *   
)

Definition at line 19260 of file stdsoap2.cpp.

References soap_copy_fault(), and soap::version.

Referenced by soap_sender_fault().

19261  {
19262  return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client", faultsubcodeQName, faultstring, faultdetailXML);
19263  }
static int soap_copy_fault(struct soap *, const char *, const char *, const char *, const char *)
Definition: stdsoap2.cpp:19227
short version
Definition: stdsoap2.h:1600
void soap_serializefault ( struct soap )

Definition at line 90 of file soapC.cpp.

References soap::fault, soap_fault(), and soap_serialize_SOAP_ENV__Fault().

Referenced by soap_send_fault().

91 {
93 
94  if (soap->fault)
96 }
struct SOAP_ENV__Fault * fault
Definition: stdsoap2.h:1632
void soap_fault(struct soap *soap)
Definition: soapC.cpp:65
void soap_serialize_SOAP_ENV__Fault(struct soap *soap, const struct SOAP_ENV__Fault *a)
Definition: soapC.cpp:2088
void soap_serializeheader ( struct soap )

Definition at line 27 of file soapC.cpp.

References soap::header, and soap_serialize_SOAP_ENV__Header().

Referenced by MiriamWebServicesSoapBindingProxy::checkRegExp(), MiriamWebServicesSoapBindingProxy::getDataResources(), MiriamWebServicesSoapBindingProxy::getDataTypeDef(), MiriamWebServicesSoapBindingProxy::getDataTypePattern(), MiriamWebServicesSoapBindingProxy::getDataTypesId(), MiriamWebServicesSoapBindingProxy::getDataTypesName(), MiriamWebServicesSoapBindingProxy::getDataTypeSynonyms(), MiriamWebServicesSoapBindingProxy::getDataTypeURI(), MiriamWebServicesSoapBindingProxy::getDataTypeURIs(), MiriamWebServicesSoapBindingProxy::getJavaLibraryVersion(), MiriamWebServicesSoapBindingProxy::getLocation(), MiriamWebServicesSoapBindingProxy::getLocations(), MiriamWebServicesSoapBindingProxy::getLocations_(), MiriamWebServicesSoapBindingProxy::getMiriamURI(), MiriamWebServicesSoapBindingProxy::getName(), MiriamWebServicesSoapBindingProxy::getNames(), MiriamWebServicesSoapBindingProxy::getOfficialDataTypeURI(), MiriamWebServicesSoapBindingProxy::getResourceInfo(), MiriamWebServicesSoapBindingProxy::getResourceInstitution(), MiriamWebServicesSoapBindingProxy::getResourceLocation(), MiriamWebServicesSoapBindingProxy::getServicesInfo(), MiriamWebServicesSoapBindingProxy::getServicesVersion(), MiriamWebServicesSoapBindingProxy::getURI(), MiriamWebServicesSoapBindingProxy::isDeprecated(), and soap_send_fault().

28 {
29  if (soap->header)
31 }
struct SOAP_ENV__Header * header
Definition: stdsoap2.h:1631
void soap_serialize_SOAP_ENV__Header(struct soap *soap, const struct SOAP_ENV__Header *a)
Definition: soapC.cpp:2794
int soap_set_attr ( struct soap soap,
const char *  name,
const char *  value 
)

Definition at line 10035 of file stdsoap2.cpp.

References soap::attributes, DBGLOG, soap::error, soap::id, soap::mode, soap_attribute::name, soap_attribute::next, soap_attribute::ns, soap::part, soap_attribute::size, SOAP_BEGIN_SECURITY, SOAP_EOM, SOAP_FREE, SOAP_MALLOC, SOAP_OK, SOAP_STR_EOS, SOAP_XML_CANONICAL, soap_attribute::value, and soap_attribute::visible.

Referenced by soap_attribute(), soap_body_begin_out(), soap_element_start_end_out(), soap_out_SOAP_ENV__Reason(), and soap_QName2s().

10036  {
10037  register struct soap_attribute *tp;
10038 
10039  if (*name == '-')
10040  return SOAP_OK;
10041 
10042  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set attribute %s='%s'\n", name, value ? value : SOAP_STR_EOS));
10043 
10044  for (tp = soap->attributes; tp; tp = tp->next)
10045  {
10046  if (!strcmp(tp->name, name))
10047  break;
10048  }
10049 
10050  if (!tp)
10051  {
10052  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute %s\n", name));
10053 
10054  if (!(tp = (struct soap_attribute*)SOAP_MALLOC(soap, sizeof(struct soap_attribute) + strlen(name))))
10055  return soap->error = SOAP_EOM;
10056 
10057  tp->ns = NULL;
10058 #ifndef WITH_LEAN
10059 
10060  if (soap->mode & SOAP_XML_CANONICAL)
10061  {
10062  struct soap_attribute **tpp = &soap->attributes;
10063  const char *s = strchr(name, ':');
10064  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inserting attribute %s for c14n\n", name))
10065 
10066  if (!strncmp(name, "xmlns", 5))
10067  {
10068  for (; *tpp; tpp = &(*tpp)->next)
10069  if (strncmp((*tpp)->name, "xmlns", 5) || strcmp((*tpp)->name + 5, name + 5) > 0)
10070  break;
10071  }
10072  else if (!s)
10073  {
10074  for (; *tpp; tpp = &(*tpp)->next)
10075  if (strncmp((*tpp)->name, "xmlns", 5) && ((*tpp)->ns || strcmp((*tpp)->name, name) > 0))
10076  break;
10077  }
10078  else
10079  {
10080  int k;
10081 
10082  for (; *tpp; tpp = &(*tpp)->next)
10083  {
10084  if (!strncmp((*tpp)->name, "xmlns:", 6) && !strncmp((*tpp)->name + 6, name, s - name) && !(*tpp)->name[6 + s - name])
10085  {
10086  if (!tp->ns)
10087  {
10088  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Canonicalization: prefix %s=%p (%s)\n", name, (*tpp)->ns, (*tpp)->ns));
10089  tp->ns = (*tpp)->ns;
10090  }
10091  }
10092  else if (strncmp((*tpp)->name, "xmlns", 5) && (*tpp)->ns && tp->ns && ((k = strcmp((*tpp)->ns, tp->ns)) > 0 || (!k && strcmp((*tpp)->name, name) > 0)))
10093  break;
10094  }
10095  }
10096 
10097  tp->next = *tpp;
10098  *tpp = tp;
10099  }
10100  else
10101 #endif
10102 
10103  {
10104  tp->next = soap->attributes;
10105  soap->attributes = tp;
10106  }
10107 
10108  strcpy(tp->name, name);
10109  tp->value = NULL;
10110  }
10111  else if (tp->visible)
10112  {
10113  return SOAP_OK;
10114  }
10115  else if (value && tp->value && tp->size <= strlen(value))
10116  {
10117  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free attribute value of %s (free %p)\n", name, tp->value));
10118  SOAP_FREE(soap, tp->value);
10119  tp->value = NULL;
10120  tp->ns = NULL;
10121  }
10122 
10123  if (value)
10124  {
10125  if (!tp->value)
10126  {
10127  tp->size = strlen(value) + 1;
10128 
10129  if (!(tp->value = (char*)SOAP_MALLOC(soap, tp->size)))
10130  return soap->error = SOAP_EOM;
10131 
10132  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute value for %s (%p)\n", tp->name, tp->value));
10133  }
10134 
10135  strcpy(tp->value, value);
10136 
10137  if (!strncmp(tp->name, "xmlns:", 6))
10138  tp->ns = tp->value;
10139 
10140  tp->visible = 2;
10141 #ifndef WITH_LEAN
10142 
10143  if (!strcmp(name, "wsu:Id"))
10144  {
10145  soap->part = SOAP_BEGIN_SECURITY;
10146  strncpy(soap->id, value, sizeof(soap->id));
10147  soap->id[sizeof(soap->id) - 1] = '\0';
10148  }
10149 
10150 #endif
10151  }
10152  else
10153  tp->visible = 1;
10154 
10155  return SOAP_OK;
10156  }
int error
Definition: stdsoap2.h:1755
short part
Definition: stdsoap2.h:1729
soap_mode mode
Definition: stdsoap2.h:1601
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
struct soap_attribute * next
Definition: stdsoap2.h:1337
#define SOAP_BEGIN_SECURITY
Definition: stdsoap2.h:1163
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
char id[(1024)]
Definition: stdsoap2.h:1714
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
char name[1]
Definition: stdsoap2.h:1342
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
#define SOAP_EOM
Definition: stdsoap2.h:1015
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
if(!yymsg) yymsg
char * value
Definition: stdsoap2.h:1338
void soap_set_dime ( struct soap )

Definition at line 15425 of file stdsoap2.cpp.

References soap::dime, soap_dime::first, soap_dime::last, soap::omode, and SOAP_ENC_DIME.

15426  {
15427  soap->omode |= SOAP_ENC_DIME;
15428  soap->dime.first = NULL;
15429  soap->dime.last = NULL;
15430  }
struct soap_multipart * first
Definition: stdsoap2.h:1397
struct soap_dime dime
Definition: stdsoap2.h:1760
soap_mode omode
Definition: stdsoap2.h:1603
struct soap_multipart * last
Definition: stdsoap2.h:1397
#define SOAP_ENC_DIME
Definition: stdsoap2.h:1099
int soap_set_dime_attachment ( struct soap ,
char *  ptr,
size_t  size,
const char *  type,
const char *  id,
unsigned short  optype,
const char *  option 
)

Definition at line 15524 of file stdsoap2.cpp.

References soap::dime, soap_dime::first, soap_multipart::id, soap_dime::last, soap_multipart::options, soap_dime_option(), SOAP_EOM, soap_new_multipart(), SOAP_OK, soap_strdup(), and soap_multipart::type.

15525  {
15526  struct soap_multipart *content = soap_new_multipart(soap, &soap->dime.first, &soap->dime.last, ptr, size);
15527 
15528  if (!content)
15529  return SOAP_EOM;
15530 
15531  content->id = soap_strdup(soap, id);
15532  content->type = soap_strdup(soap, type);
15533  content->options = soap_dime_option(soap, optype, option);
15534  return SOAP_OK;
15535  }
const char * id
Definition: stdsoap2.h:1444
struct soap_multipart * first
Definition: stdsoap2.h:1397
static struct soap_multipart * soap_new_multipart(struct soap *, struct soap_multipart **, struct soap_multipart **, char *, size_t)
Definition: stdsoap2.cpp:15487
struct soap_dime dime
Definition: stdsoap2.h:1760
char * soap_dime_option(struct soap *soap, unsigned short optype, const char *option)
Definition: stdsoap2.cpp:14436
struct soap_multipart * last
Definition: stdsoap2.h:1397
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_EOM
Definition: stdsoap2.h:1015
const char * options
Definition: stdsoap2.h:1446
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
const char * type
Definition: stdsoap2.h:1445
void soap_set_embedded ( struct soap ,
struct soap_plist  
)

Definition at line 6869 of file stdsoap2.cpp.

References soap_plist::mark1, soap_plist::mark2, soap::mode, and SOAP_IO_LENGTH.

Referenced by soap_element_id(), and soap_embed().

6870  {
6871  if (!pp)
6872  return;
6873 
6874  if (soap->mode & SOAP_IO_LENGTH)
6875  pp->mark1 = 1;
6876  else
6877  pp->mark2 = 1;
6878  }
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_IO_LENGTH
Definition: stdsoap2.h:1094
void soap_set_endpoint ( struct soap ,
const char *   
)

Definition at line 17735 of file stdsoap2.cpp.

References soap::endpoint, soap::host, soap::path, soap::port, and soap_tag_cmp().

Referenced by soap_try_connect_command().

17736  {
17737  register const char *s;
17738  register size_t i, n;
17739  soap->endpoint[0] = '\0';
17740  soap->host[0] = '\0';
17741  soap->path[0] = '/';
17742  soap->path[1] = '\0';
17743  soap->port = 80;
17744 
17745  if (!endpoint || !*endpoint)
17746  return;
17747 
17748 #ifdef WITH_OPENSSL
17749 
17750  if (!soap_tag_cmp(endpoint, "https:*"))
17751  soap->port = 443;
17752 
17753 #endif
17754  strncpy(soap->endpoint, endpoint, sizeof(soap->endpoint) - 1);
17755  soap->endpoint[sizeof(soap->endpoint) - 1] = '\0';
17756  s = strchr(endpoint, ':');
17757 
17758  if (s && s[1] == '/' && s[2] == '/')
17759  s += 3;
17760  else
17761  s = endpoint;
17762 
17763  n = strlen(s);
17764 
17765  if (n >= sizeof(soap->host))
17766  n = sizeof(soap->host) - 1;
17767 
17768 #ifdef WITH_IPV6
17769 
17770  if (s[0] == '[')
17771  {
17772  s++;
17773 
17774  for (i = 0; i < n; i++)
17775  {
17776  if (s[i] == ']')
17777  {
17778  s++;
17779  --n;
17780  break;
17781  }
17782 
17783  soap->host[i] = s[i];
17784  }
17785  }
17786  else
17787  {
17788  for (i = 0; i < n; i++)
17789  {
17790  soap->host[i] = s[i];
17791 
17792  if (s[i] == '/' || s[i] == ':')
17793  break;
17794  }
17795  }
17796 
17797 #else
17798 
17799  for (i = 0; i < n; i++)
17800  {
17801  soap->host[i] = s[i];
17802 
17803  if (s[i] == '/' || s[i] == ':')
17804  break;
17805  }
17806 
17807 #endif
17808  soap->host[i] = '\0';
17809 
17810  if (s[i] == ':')
17811  {
17812  soap->port = (int)atol(s + i + 1);
17813 
17814  for (i++; i < n; i++)
17815  if (s[i] == '/')
17816  break;
17817  }
17818 
17819  if (i < n && s[i])
17820  {
17821  strncpy(soap->path, s + i, sizeof(soap->path));
17822  soap->path[sizeof(soap->path) - 1] = '\0';
17823  }
17824  }
char path[(1024)]
Definition: stdsoap2.h:1735
int soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:3657
char host[(1024)]
Definition: stdsoap2.h:1736
int port
Definition: stdsoap2.h:1741
char endpoint[(1024)]
Definition: stdsoap2.h:1734
void soap_set_fault ( struct soap )

Definition at line 18724 of file stdsoap2.cpp.

References soap::d_stream, soap::error, soap::fseterror, http_error(), soap::id, soap::msgbuf, SOAP_CLI_FAULT, SOAP_DATAENCODINGUNKNOWN, SOAP_DIME_END, SOAP_DIME_ERROR, SOAP_DIME_HREF, SOAP_DIME_MISMATCH, SOAP_DUPLICATE_ID, SOAP_EOF, SOAP_EOM, SOAP_FATAL_ERROR, SOAP_FAULT, soap_faultcode(), soap_faultstring(), soap_faultsubcode(), SOAP_FD_EXCEEDED, SOAP_GET_METHOD, SOAP_HDR, SOAP_HEAD_METHOD, SOAP_HREF, SOAP_HTTP_ERROR, SOAP_HTTP_METHOD, SOAP_IOB, SOAP_LENGTH, SOAP_MIME_END, SOAP_MIME_ERROR, SOAP_MIME_HREF, SOAP_MISSING_ID, SOAP_MOE, SOAP_MUSTUNDERSTAND, SOAP_NAMESPACE, SOAP_NO_DATA, SOAP_NO_METHOD, SOAP_NO_TAG, SOAP_NULL, SOAP_OCCURS, SOAP_PLUGIN_ERROR, SOAP_PROHIBITED, SOAP_PUT_METHOD, SOAP_REQUIRED, soap_set_validation_fault(), SOAP_SSL_ERROR, SOAP_STOP, SOAP_STR_EOS, soap_strerror(), SOAP_SVR_FAULT, SOAP_SYNTAX_ERROR, SOAP_TAG_MISMATCH, SOAP_TCP_ERROR, SOAP_TYPE, SOAP_UDP_ERROR, SOAP_USER_ERROR, SOAP_VERSIONMISMATCH, SOAP_ZLIB_ERROR, soap::tag, tcp_error(), soap::type, and soap::version.

Referenced by soap_print_fault(), soap_recv_fault(), soap_send_fault(), and soap_sprint_fault().

18725  {
18726  const char **c = soap_faultcode(soap);
18727  const char **s = soap_faultstring(soap);
18728 
18729  if (soap->fseterror)
18730  soap->fseterror(soap, c, s);
18731 
18732  if (!*c)
18733  {
18734  if (soap->version == 2)
18735  *c = "SOAP-ENV:Sender";
18736  else
18737  *c = "SOAP-ENV:Client";
18738  }
18739 
18740  if (*s)
18741  return;
18742 
18743  switch (soap->error)
18744  {
18745 #ifndef WITH_LEAN
18746  case SOAP_CLI_FAULT:
18747  *s = "Client fault";
18748  break;
18749  case SOAP_SVR_FAULT:
18750  *s = "Server fault";
18751  break;
18752  case SOAP_TAG_MISMATCH:
18753  *s = soap_set_validation_fault(soap, "tag name or namespace mismatch", NULL);
18754  break;
18755  case SOAP_TYPE:
18756  *s = soap_set_validation_fault(soap, "data type mismatch ", soap->type);
18757  break;
18758  case SOAP_SYNTAX_ERROR:
18759  *s = "Well-formedness violation";
18760  break;
18761  case SOAP_NO_TAG:
18762  *s = "No XML element tag";
18763  break;
18764  case SOAP_MUSTUNDERSTAND:
18765  *c = "SOAP-ENV:MustUnderstand";
18766  sprintf(soap->msgbuf, "The data in element '%s' must be understood but cannot be handled", soap->tag);
18767  *s = soap->msgbuf;
18768  break;
18769  case SOAP_VERSIONMISMATCH:
18770  *c = "SOAP-ENV:VersionMismatch";
18771  *s = "Invalid SOAP message or SOAP version mismatch";
18772  break;
18774  *c = "SOAP-ENV:DataEncodingUnknown";
18775  *s = "Unsupported SOAP data encoding";
18776  break;
18777  case SOAP_NAMESPACE:
18778  *s = soap_set_validation_fault(soap, "namespace error", NULL);
18779  break;
18780  case SOAP_USER_ERROR:
18781  *s = "User error";
18782  break;
18783  case SOAP_FATAL_ERROR:
18784  *s = "Fatal error";
18785  break;
18786  case SOAP_NO_METHOD:
18787  sprintf(soap->msgbuf, "Method '%s' not implemented: method name or namespace not recognized", soap->tag);
18788  *s = soap->msgbuf;
18789  break;
18790  case SOAP_NO_DATA:
18791  *s = "Data required for operation";
18792  break;
18793  case SOAP_GET_METHOD:
18794  *s = "HTTP GET method not implemented";
18795  break;
18796  case SOAP_PUT_METHOD:
18797  *s = "HTTP PUT method not implemented";
18798  break;
18799  case SOAP_HEAD_METHOD:
18800  *s = "HTTP HEAD method not implemented";
18801  break;
18802  case SOAP_HTTP_METHOD:
18803  *s = "HTTP method not implemented";
18804  break;
18805  case SOAP_EOM:
18806  *s = "Out of memory";
18807  break;
18808  case SOAP_MOE:
18809  *s = "Memory overflow or memory corruption error";
18810  break;
18811  case SOAP_HDR:
18812  *s = "Header line too long";
18813  break;
18814  case SOAP_IOB:
18815  *s = "Array index out of bounds";
18816  break;
18817  case SOAP_NULL:
18818  *s = soap_set_validation_fault(soap, "nil not allowed", NULL);
18819  break;
18820  case SOAP_DUPLICATE_ID:
18821  *s = soap_set_validation_fault(soap, "multiple definitions of id ", soap->id);
18822 
18823  if (soap->version == 2)
18824  *soap_faultsubcode(soap) = "SOAP-ENC:DuplicateID";
18825 
18826  break;
18827  case SOAP_MISSING_ID:
18828  *s = soap_set_validation_fault(soap, "missing id for ref ", soap->id);
18829 
18830  if (soap->version == 2)
18831  *soap_faultsubcode(soap) = "SOAP-ENC:MissingID";
18832 
18833  break;
18834  case SOAP_HREF:
18835  *s = soap_set_validation_fault(soap, "incompatible object type ref/id pair ", soap->id);
18836  break;
18837  case SOAP_FAULT:
18838  break;
18839 #ifndef WITH_NOIO
18840  case SOAP_UDP_ERROR:
18841  *s = "Message too large for UDP packet";
18842  break;
18843  case SOAP_TCP_ERROR:
18844  *s = tcp_error(soap);
18845  break;
18846 #endif
18847  case SOAP_HTTP_ERROR:
18848  *s = "An HTTP processing error occurred";
18849  break;
18850  case SOAP_SSL_ERROR:
18851 #ifdef WITH_OPENSSL
18852  *s = "SSL error";
18853 #else
18854  *s = "OpenSSL not installed: recompile with -DWITH_OPENSSL";
18855 #endif
18856  break;
18857  case SOAP_PLUGIN_ERROR:
18858  *s = "Plugin registry error";
18859  break;
18860  case SOAP_DIME_ERROR:
18861  *s = "DIME format error";
18862  break;
18863  case SOAP_DIME_HREF:
18864  *s = "DIME href to missing attachment";
18865  break;
18866  case SOAP_DIME_MISMATCH:
18867  *s = "DIME version/transmission error";
18868  break;
18869  case SOAP_DIME_END:
18870  *s = "End of DIME error";
18871  break;
18872  case SOAP_MIME_ERROR:
18873  *s = "MIME format error";
18874  break;
18875  case SOAP_MIME_HREF:
18876  *s = "MIME href to missing attachment";
18877  break;
18878  case SOAP_MIME_END:
18879  *s = "End of MIME error";
18880  break;
18881  case SOAP_ZLIB_ERROR:
18882 #ifdef WITH_ZLIB
18883  sprintf(soap->msgbuf, "Zlib/gzip error: '%s'", soap->d_stream->msg ? soap->d_stream->msg : SOAP_STR_EOS);
18884  *s = soap->msgbuf;
18885 #else
18886  *s = "Zlib/gzip not installed for (de)compression: recompile with -DWITH_GZIP";
18887 #endif
18888  break;
18889  case SOAP_REQUIRED:
18890  *s = soap_set_validation_fault(soap, "missing required attribute", NULL);
18891  break;
18892  case SOAP_PROHIBITED:
18893  *s = soap_set_validation_fault(soap, "prohibited attribute present", NULL);
18894  break;
18895  case SOAP_OCCURS:
18896  *s = soap_set_validation_fault(soap, "occurrence violation", NULL);
18897  break;
18898  case SOAP_LENGTH:
18899  *s = soap_set_validation_fault(soap, "content range or length violation", NULL);
18900  break;
18901  case SOAP_FD_EXCEEDED:
18902  *s = "Maximum number of open connections was reached";
18903  break;
18904  case SOAP_STOP:
18905  *s = "Stopped: no response sent";
18906  break;
18907 #endif
18908  case SOAP_EOF:
18909 #ifndef WITH_NOIO
18910  strcpy(soap->msgbuf, soap_strerror(soap));
18911 #ifndef WITH_LEAN
18912 
18913  if (strlen(soap->msgbuf) + 25 < sizeof(soap->msgbuf))
18914  {
18915  memmove(soap->msgbuf + 25, soap->msgbuf, strlen(soap->msgbuf) + 1);
18916  memcpy(soap->msgbuf, "End of file or no input: ", 25);
18917  }
18918 
18919 #endif
18920  *s = soap->msgbuf;
18921  break;
18922 #else
18923  *s = "End of file or no input";
18924  break;
18925 #endif
18926  default:
18927 #ifndef WITH_NOHTTP
18928 #ifndef WITH_LEAN
18929 
18930  if (soap->error > 200 && soap->error < 600)
18931  {
18932  sprintf(soap->msgbuf, "HTTP Error: %d %s", soap->error, http_error(soap, soap->error));
18933  *s = soap->msgbuf;
18934  }
18935  else
18936 #endif
18937 #endif
18938 
18939  {
18940  sprintf(soap->msgbuf, "Error %d", soap->error);
18941  *s = soap->msgbuf;
18942  }
18943  }
18944  }
#define SOAP_FAULT
Definition: stdsoap2.h:1007
#define SOAP_MUSTUNDERSTAND
Definition: stdsoap2.h:1003
#define SOAP_MOE
Definition: stdsoap2.h:1016
char msgbuf[1024]
Definition: stdsoap2.h:1711
#define SOAP_FATAL_ERROR
Definition: stdsoap2.h:1006
char tag[(1024)]
Definition: stdsoap2.h:1713
int error
Definition: stdsoap2.h:1755
#define SOAP_NULL
Definition: stdsoap2.h:1018
#define SOAP_DATAENCODINGUNKNOWN
Definition: stdsoap2.h:1036
#define SOAP_HREF
Definition: stdsoap2.h:1021
#define SOAP_UDP_ERROR
Definition: stdsoap2.h:1022
#define SOAP_IOB
Definition: stdsoap2.h:1002
#define SOAP_NO_TAG
Definition: stdsoap2.h:1001
#define SOAP_DIME_HREF
Definition: stdsoap2.h:1028
short version
Definition: stdsoap2.h:1600
#define SOAP_MIME_HREF
Definition: stdsoap2.h:1032
#define SOAP_MIME_ERROR
Definition: stdsoap2.h:1031
static const char * http_error(struct soap *, int)
Definition: stdsoap2.cpp:4540
#define SOAP_TYPE
Definition: stdsoap2.h:999
#define SOAP_MISSING_ID
Definition: stdsoap2.h:1020
#define SOAP_NO_METHOD
Definition: stdsoap2.h:1008
const char ** soap_faultsubcode(struct soap *soap)
Definition: soapC.cpp:121
#define SOAP_PLUGIN_ERROR
Definition: stdsoap2.h:1035
#define SOAP_PUT_METHOD
Definition: stdsoap2.h:1011
#define SOAP_USER_ERROR
Definition: stdsoap2.h:1005
void * d_stream
Definition: stdsoap2.h:1822
#define SOAP_VERSIONMISMATCH
Definition: stdsoap2.h:1034
#define SOAP_SVR_FAULT
Definition: stdsoap2.h:997
#define SOAP_HDR
Definition: stdsoap2.h:1017
#define SOAP_DIME_MISMATCH
Definition: stdsoap2.h:1029
#define SOAP_MIME_END
Definition: stdsoap2.h:1033
#define SOAP_STOP
Definition: stdsoap2.h:1056
#define SOAP_OCCURS
Definition: stdsoap2.h:1039
const char ** soap_faultstring(struct soap *soap)
Definition: soapC.cpp:139
#define SOAP_SSL_ERROR
Definition: stdsoap2.h:1025
char id[(1024)]
Definition: stdsoap2.h:1714
static const char * tcp_error(struct soap *)
Definition: stdsoap2.cpp:4506
const char ** soap_faultcode(struct soap *soap)
Definition: soapC.cpp:111
#define SOAP_DIME_ERROR
Definition: stdsoap2.h:1027
#define SOAP_HEAD_METHOD
Definition: stdsoap2.h:1013
void(* fseterror)(struct soap *, const char **c, const char **s)
Definition: stdsoap2.h:1660
#define SOAP_TAG_MISMATCH
Definition: stdsoap2.h:998
#define SOAP_DIME_END
Definition: stdsoap2.h:1030
#define SOAP_SYNTAX_ERROR
Definition: stdsoap2.h:1000
#define SOAP_PROHIBITED
Definition: stdsoap2.h:1038
#define SOAP_HTTP_METHOD
Definition: stdsoap2.h:1014
char type[(1024)]
Definition: stdsoap2.h:1716
#define SOAP_DUPLICATE_ID
Definition: stdsoap2.h:1019
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
#define SOAP_REQUIRED
Definition: stdsoap2.h:1037
#define SOAP_TCP_ERROR
Definition: stdsoap2.h:1023
#define SOAP_NO_DATA
Definition: stdsoap2.h:1009
#define SOAP_EOM
Definition: stdsoap2.h:1015
#define SOAP_LENGTH
Definition: stdsoap2.h:1040
#define SOAP_ZLIB_ERROR
Definition: stdsoap2.h:1026
#define SOAP_NAMESPACE
Definition: stdsoap2.h:1004
#define SOAP_EOF
Definition: stdsoap2.h:993
static const char * soap_set_validation_fault(struct soap *, const char *, const char *)
Definition: stdsoap2.cpp:18708
#define SOAP_HTTP_ERROR
Definition: stdsoap2.h:1024
#define SOAP_FD_EXCEEDED
Definition: stdsoap2.h:1041
#define SOAP_GET_METHOD
Definition: stdsoap2.h:1010
#define SOAP_CLI_FAULT
Definition: stdsoap2.h:996
static const char * soap_strerror(struct soap *)
Definition: stdsoap2.cpp:19129
void soap_set_local_namespaces ( struct soap )

Definition at line 8831 of file stdsoap2.cpp.

References Namespace::id, soap::local_namespaces, soap::namespaces, Namespace::ns, SOAP_MALLOC, and soap::version.

Referenced by soap_begin_count(), soap_begin_recv(), soap_begin_send(), and soap_set_namespaces().

8832  {
8834  {
8835  register const struct Namespace *ns1;
8836  register struct Namespace *ns2;
8837  register size_t n = 1;
8838 
8839  for (ns1 = soap->namespaces; ns1->id; ns1++)
8840  n++;
8841 
8842  n *= sizeof(struct Namespace);
8843  ns2 = (struct Namespace*)SOAP_MALLOC(soap, n);
8844 
8845  if (ns2)
8846  {
8847  memcpy(ns2, soap->namespaces, n);
8848 
8849  if (ns2[0].ns)
8850  {
8851  if (!strcmp(ns2[0].ns, soap_env1))
8852  soap->version = 1;
8853  else
8854  soap->version = 2;
8855  }
8856 
8857  soap->local_namespaces = ns2;
8858  }
8859  }
8860  }
static const char soap_env1[42]
Definition: stdsoap2.cpp:284
short version
Definition: stdsoap2.h:1600
const struct Namespace * namespaces
Definition: stdsoap2.h:1621
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
#define SOAP_MALLOC(soap, size)
Definition: stdsoap2.h:1190
const char * ns
Definition: stdsoap2.h:1263
const char * id
Definition: stdsoap2.h:1262
void soap_set_mime ( struct soap ,
const char *  boundary,
const char *  start 
)

Definition at line 15440 of file stdsoap2.cpp.

References soap_mime::boundary, soap_mime::first, soap_mime::last, soap::mime, soap::omode, SOAP_ENC_MIME, soap_strdup(), and soap_mime::start.

15441  {
15442  soap->omode |= SOAP_ENC_MIME;
15443  soap->mime.first = NULL;
15444  soap->mime.last = NULL;
15445  soap->mime.boundary = soap_strdup(soap, boundary);
15446  soap->mime.start = soap_strdup(soap, start);
15447  }
struct soap_multipart * first
Definition: stdsoap2.h:1413
soap_mode omode
Definition: stdsoap2.h:1603
const char * start
Definition: stdsoap2.h:1411
struct soap_multipart * last
Definition: stdsoap2.h:1413
char * boundary
Definition: stdsoap2.h:1410
struct soap_mime mime
Definition: stdsoap2.h:1761
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
#define SOAP_ENC_MIME
Definition: stdsoap2.h:1100
int soap_set_mime_attachment ( struct soap ,
char *  ptr,
size_t  size,
enum soap_mime_encoding  encoding,
const char *  type,
const char *  id,
const char *  location,
const char *  description 
)

Definition at line 15545 of file stdsoap2.cpp.

References soap_multipart::description, soap_multipart::encoding, soap_mime::first, soap_multipart::id, soap_mime::last, soap_multipart::location, soap::mime, SOAP_EOM, soap_new_multipart(), SOAP_OK, soap_strdup(), and soap_multipart::type.

Referenced by soap_getmimehdr().

15546  {
15547  struct soap_multipart *content = soap_new_multipart(soap, &soap->mime.first, &soap->mime.last, ptr, size);
15548 
15549  if (!content)
15550  return SOAP_EOM;
15551 
15552  content->id = soap_strdup(soap, id);
15553  content->type = soap_strdup(soap, type);
15554  content->encoding = encoding;
15555  content->location = soap_strdup(soap, location);
15556  content->description = soap_strdup(soap, description);
15557  return SOAP_OK;
15558  }
const char * id
Definition: stdsoap2.h:1444
struct soap_multipart * first
Definition: stdsoap2.h:1413
const char * location
Definition: stdsoap2.h:1448
static struct soap_multipart * soap_new_multipart(struct soap *, struct soap_multipart **, struct soap_multipart **, char *, size_t)
Definition: stdsoap2.cpp:15487
enum soap_mime_encoding encoding
Definition: stdsoap2.h:1447
struct soap_multipart * last
Definition: stdsoap2.h:1413
#define SOAP_OK
Definition: stdsoap2.h:995
const char * description
Definition: stdsoap2.h:1449
#define SOAP_EOM
Definition: stdsoap2.h:1015
struct soap_mime mime
Definition: stdsoap2.h:1761
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
const char * type
Definition: stdsoap2.h:1445
int soap_set_namespaces ( struct soap ,
const struct Namespace  
)

Definition at line 8756 of file stdsoap2.cpp.

References soap::error, Namespace::id, soap_nlist::id, soap_nlist::index, soap_nlist::level, soap::level, soap::local_namespaces, soap::namespaces, soap_nlist::next, soap::nlist, Namespace::ns, soap_nlist::ns, Namespace::out, SOAP_FREE, SOAP_OK, soap_push_namespace(), and soap_set_local_namespaces().

8757  {
8758  register struct Namespace *ns = soap->local_namespaces;
8759  register struct soap_nlist *np, *nq, *nr;
8760  register unsigned int level = soap->level;
8761  soap->namespaces = p;
8762  soap->local_namespaces = NULL;
8764  /* reverse the namespace list */
8765  np = soap->nlist;
8766  soap->nlist = NULL;
8767 
8768  if (np)
8769  {
8770  nq = np->next;
8771  np->next = NULL;
8772 
8773  while (nq)
8774  {
8775  nr = nq->next;
8776  nq->next = np;
8777  np = nq;
8778  nq = nr;
8779  }
8780  }
8781 
8782  /* then push on new stack */
8783  while (np)
8784  {
8785  register const char *s;
8786  soap->level = np->level; /* preserve element nesting level */
8787  s = np->ns;
8788 
8789  if (!s && np->index >= 0 && ns)
8790  {
8791  s = ns[np->index].out;
8792 
8793  if (!s)
8794  s = ns[np->index].ns;
8795  }
8796 
8797  if (s && soap_push_namespace(soap, np->id, s))
8798  return soap->error;
8799 
8800  nq = np;
8801  np = np->next;
8802  SOAP_FREE(soap, nq);
8803  }
8804 
8805  if (ns)
8806  {
8807  register int i;
8808 
8809  for (i = 0; ns[i].id; i++)
8810  {
8811  if (ns[i].out)
8812  {
8813  SOAP_FREE(soap, ns[i].out);
8814  ns[i].out = NULL;
8815  }
8816  }
8817 
8818  SOAP_FREE(soap, ns);
8819  }
8820 
8821  soap->level = level; /* restore level */
8822  return SOAP_OK;
8823  }
int error
Definition: stdsoap2.h:1755
unsigned int level
Definition: stdsoap2.h:1704
const struct Namespace * namespaces
Definition: stdsoap2.h:1621
void soap_set_local_namespaces(struct soap *soap)
Definition: stdsoap2.cpp:8831
char id[1]
Definition: stdsoap2.h:1275
char * ns
Definition: stdsoap2.h:1274
struct Namespace * local_namespaces
Definition: stdsoap2.h:1622
char * out
Definition: stdsoap2.h:1265
short index
Definition: stdsoap2.h:1273
const char * ns
Definition: stdsoap2.h:1263
unsigned int level
Definition: stdsoap2.h:1272
int soap_push_namespace(struct soap *soap, const char *id, const char *ns)
Definition: stdsoap2.cpp:3483
struct soap_nlist * next
Definition: stdsoap2.h:1271
#define SOAP_OK
Definition: stdsoap2.h:995
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
const char * id
Definition: stdsoap2.h:1262
struct soap_nlist * nlist
Definition: stdsoap2.h:1623
int soap_set_receiver_error ( struct soap ,
const char *  ,
const char *  ,
int   
)

Definition at line 19218 of file stdsoap2.cpp.

References soap_set_error(), and soap::version.

Referenced by http_parse(), soap_accept(), soap_bind(), and soap_poll().

19219  {
19220  return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : "SOAP-ENV:Server", NULL, faultstring, faultdetailXML, soaperror);
19221  }
short version
Definition: stdsoap2.h:1600
static int soap_set_error(struct soap *, const char *, const char *, const char *, const char *, int)
Definition: stdsoap2.cpp:19181
int soap_set_sender_error ( struct soap ,
const char *  ,
const char *  ,
int   
)

Definition at line 19207 of file stdsoap2.cpp.

References soap_set_error(), and soap::version.

Referenced by soap_accept(), and tcp_connect().

19208  {
19209  return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client", NULL, faultstring, faultdetailXML, soaperror);
19210  }
short version
Definition: stdsoap2.h:1600
static int soap_set_error(struct soap *, const char *, const char *, const char *, const char *, int)
Definition: stdsoap2.cpp:19181
const char* soap_short2s ( struct soap ,
short   
)

Definition at line 12345 of file stdsoap2.cpp.

References soap_long2s().

12346  {
12347  return soap_long2s(soap, (long)n);
12348  }
const char * soap_long2s(struct soap *soap, long n)
Definition: stdsoap2.cpp:12047
int soap_size ( const int *  ,
int   
)

Definition at line 3318 of file stdsoap2.cpp.

3319  {
3320  register int i, n = size[0];
3321 
3322  for (i = 1; i < dim; i++)
3323  n *= size[i];
3324 
3325  return n;
3326  }
size_t soap_size_block ( struct soap ,
struct soap_blist ,
size_t   
)

Definition at line 3038 of file stdsoap2.cpp.

References soap::blist, soap_blist::ptr, and soap_blist::size.

Referenced by soap_get_http_body(), soap_get_mime_attachment(), soap_getbase64(), soap_gethex(), soap_string_in(), and soap_wstring_in().

3039  {
3040  if (!b)
3041  b = soap->blist;
3042 
3043  if (b->ptr)
3044  {
3045  b->size -= *(size_t*)(b->ptr + sizeof(char*)) - n;
3046  *(size_t*)(b->ptr + sizeof(char*)) = n;
3047  }
3048 
3049  return b->size;
3050  }
struct soap_blist * blist
Definition: stdsoap2.h:1624
size_t size
Definition: stdsoap2.h:1283
char* soap_sprint_fault ( struct soap ,
char *  ,
size_t   
)

Definition at line 19366 of file stdsoap2.cpp.

References soap::error, soap_check_state, soap_faultcode(), soap_faultdetail(), soap_faultstring(), soap_faultsubcode(), soap_set_fault(), and soap::version.

Referenced by MiriamWebServicesSoapBindingProxy::soap_sprint_fault().

19367  {
19368  if (soap_check_state(soap))
19369  strncpy(buf, "Error: soap struct not initialized", len);
19370  else if (soap->error)
19371  {
19372  const char *c, *v = NULL, *s, **d;
19373  d = soap_faultcode(soap);
19374 
19375  if (!*d)
19377 
19378  c = *d;
19379 
19380  if (soap->version == 2)
19381  v = *soap_faultsubcode(soap);
19382 
19383  s = *soap_faultstring(soap);
19384  d = soap_faultdetail(soap);
19385 #ifdef WIN32
19386  _snprintf
19387 #else
19388  snprintf
19389 #endif
19390  (buf, len, "%s%d fault: %s [%s]\n\"%s\"\nDetail: %s\n", soap->version ? "SOAP 1." : "Error ", soap->version ? (int)soap->version : soap->error, c, v ? v : "no subcode", s ? s : "[no reason]", d && *d ? *d : "[no detail]");
19391  }
19392 
19393  return buf;
19394  }
int error
Definition: stdsoap2.h:1755
void soap_set_fault(struct soap *soap)
Definition: stdsoap2.cpp:18724
short version
Definition: stdsoap2.h:1600
const char ** soap_faultsubcode(struct soap *soap)
Definition: soapC.cpp:121
const char ** soap_faultdetail(struct soap *soap)
Definition: soapC.cpp:149
const char ** soap_faultstring(struct soap *soap)
Definition: soapC.cpp:139
const char ** soap_faultcode(struct soap *soap)
Definition: soapC.cpp:111
#define soap_check_state(soap)
Definition: stdsoap2.h:1150
int soap_ssl_accept ( struct soap )
int soap_ssl_client_context ( struct soap ,
unsigned  short,
const char *  ,
const char *  ,
const char *  ,
const char *  ,
const char *   
)
const char* soap_ssl_error ( struct soap ,
int   
)

Referenced by tcp_connect().

void soap_ssl_init ( )

Referenced by soap_init().

int soap_ssl_server_context ( struct soap ,
unsigned  short,
const char *  ,
const char *  ,
const char *  ,
const char *  ,
const char *  ,
const char *  ,
const char *   
)
int soap_store_lab ( struct soap ,
const char *  ,
size_t   
)

Definition at line 10275 of file stdsoap2.cpp.

References soap::labidx, and soap_append_lab().

Referenced by soap_peek_element().

10276  {
10277  soap->labidx = 0;
10278  return soap_append_lab(soap, s, n);
10279  }
size_t labidx
Definition: stdsoap2.h:1709
int soap_append_lab(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:10289
char* soap_strdup ( struct soap ,
const char *   
)
char* soap_string_in ( struct soap ,
int  ,
long  ,
long   
)

Definition at line 11015 of file stdsoap2.cpp.

References soap::attributes, soap::body, soap_dom_element::data, DBGLOG, soap::dom, soap::error, soap::labbuf, soap::labidx, soap::lablen, soap::mode, soap_attribute::name, soap_attribute::next, soap::peeked, SOAP_AP, soap_append_lab(), SOAP_BLKLEN, SOAP_C_MBSTRING, SOAP_C_UTFSTRING, SOAP_ENC_LATIN, soap_get(), soap_getchar(), soap_getutf8(), SOAP_GT, SOAP_LENGTH, SOAP_LT, soap_new_block(), soap_push_block(), SOAP_QT, soap_s2QName(), soap_save_block(), soap_size_block(), soap_strdup(), SOAP_TT, soap_unget, SOAP_UNKNOWN_CHAR, SOAP_XML_DOM, SOAP_XML_STRICT, soap::tag, soap_dom_element::tail, soap::tmpbuf, soap_attribute::value, and soap_attribute::visible.

Referenced by soap_element_end_in(), soap_getbase64(), soap_gethex(), soap_in_std__string(), soap_inliteral(), and soap_instring().

11016  {
11017  register char *s;
11018  char *t = NULL;
11019  register size_t i;
11020  register long l = 0;
11021  register int n = 0, f = 0, m = 0;
11022  register soap_wchar c;
11023 #if !defined(WITH_LEANER) && defined(HAVE_WCTOMB)
11024  char buf[MB_LEN_MAX > 8 ? MB_LEN_MAX : 8];
11025 #else
11026  char buf[8];
11027 #endif
11028  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reading string content\n"));
11029 
11030  if (soap->peeked)
11031  {
11032  if (*soap->tag)
11033  {
11034 #ifndef WITH_LEAN
11035  struct soap_attribute *tp;
11036  t = soap->tmpbuf;
11037  *t = '<';
11038  t[sizeof(soap->tmpbuf) - 1] = '\0';
11039  strncpy(t + 1, soap->tag, sizeof(soap->tmpbuf) - 2);
11040  t += strlen(t);
11041 
11042  for (tp = soap->attributes; tp; tp = tp->next)
11043  {
11044  if (tp->visible)
11045  {
11046  if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
11047  break;
11048 
11049  *t++ = ' ';
11050  strcpy(t, tp->name);
11051  t += strlen(t);
11052 
11053  if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
11054  break; /* too many or large attribute values */
11055 
11056  if (tp->value)
11057  {
11058  *t++ = '=';
11059  *t++ = '"';
11060  strcpy(t, tp->value);
11061  t += strlen(t);
11062  *t++ = '"';
11063  }
11064  }
11065  }
11066 
11067  if (!soap->body)
11068  *t++ = '/';
11069 
11070  *t++ = '>';
11071  *t = '\0';
11072  t = soap->tmpbuf;
11073  m = (int)strlen(soap->tmpbuf);
11074 #endif
11075 
11076  if (soap->body)
11077  n = 1;
11078 
11079  f = 1;
11080  soap->peeked = 0;
11081  }
11082  }
11083 
11084 #ifdef WITH_CDATA
11085 
11086  if (!flag)
11087  {
11088  register int state = 0;
11089 #ifdef WITH_FAST
11090  soap->labidx = 0; /* use look-aside buffer */
11091 #else
11092 
11093  if (soap_new_block(soap) == NULL)
11094  return NULL;
11095 
11096 #endif
11097 
11098  for (;;)
11099  {
11100 #ifdef WITH_FAST
11101  register size_t k;
11102 
11103  if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
11104  return NULL;
11105 
11106  s = soap->labbuf + soap->labidx; /* space to populate */
11107  k = soap->lablen - soap->labidx; /* number of bytes available */
11108  soap->labidx = soap->lablen; /* claim this space */
11109 #else
11110  register size_t k = SOAP_BLKLEN;
11111 
11112  if (!(s = (char*)soap_push_block(soap, NULL, k)))
11113  return NULL;
11114 
11115 #endif
11116 
11117  for (i = 0; i < k; i++)
11118  {
11119  if (m > 0)
11120  {
11121  *s++ = *t++; /* copy multibyte characters */
11122  m--;
11123  continue;
11124  }
11125 
11126  c = soap_getchar(soap);
11127 
11128  if ((int)c == EOF)
11129  goto end;
11130 
11131  if (c >= 0x80 && state != 1 && !(soap->mode & SOAP_ENC_LATIN))
11132  {
11133  soap_unget(soap, c);
11134  c = soap_getutf8(soap);
11135 
11136  if (soap->mode & SOAP_C_UTFSTRING)
11137  {
11138  if ((c & 0x80000000) && c >= -0x7FFFFF80 && c < SOAP_AP)
11139  {
11140  c &= 0x7FFFFFFF;
11141  t = buf;
11142 
11143  if (c < 0x0800)
11144  *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
11145  else
11146  {
11147  if (c < 0x010000)
11148  *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
11149  else
11150  {
11151  if (c < 0x200000)
11152  *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
11153  else
11154  {
11155  if (c < 0x04000000)
11156  *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
11157  else
11158  {
11159  *t++ = (char)(0xFC | ((c >> 30) & 0x01));
11160  *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
11161  }
11162 
11163  *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
11164  }
11165 
11166  *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
11167  }
11168 
11169  *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
11170  }
11171 
11172  *t++ = (char)(0x80 | (c & 0x3F));
11173  m = (int)(t - buf) - 1;
11174  t = buf;
11175  *s++ = *t++;
11176  continue;
11177  }
11178  }
11179  }
11180 
11181  switch (state)
11182  {
11183  case 1:
11184 
11185  if (c == ']')
11186  state = 4;
11187 
11188  *s++ = c;
11189  continue;
11190  case 2:
11191 
11192  if (c == '-')
11193  state = 6;
11194 
11195  *s++ = c;
11196  continue;
11197  case 3:
11198 
11199  if (c == '?')
11200  state = 8;
11201 
11202  *s++ = c;
11203  continue;
11204  /* CDATA */
11205  case 4:
11206 
11207  if (c == ']')
11208  state = 5;
11209  else
11210  state = 1;
11211 
11212  *s++ = c;
11213  continue;
11214  case 5:
11215 
11216  if (c == '>')
11217  state = 0;
11218  else
11219  state = 1;
11220 
11221  *s++ = c;
11222  continue;
11223  /* comment */
11224  case 6:
11225 
11226  if (c == '-')
11227  state = 7;
11228  else
11229  state = 2;
11230 
11231  *s++ = c;
11232  continue;
11233  case 7:
11234 
11235  if (c == '>')
11236  state = 0;
11237  else
11238  state = 2;
11239 
11240  *s++ = c;
11241  continue;
11242  /* PI */
11243  case 8:
11244 
11245  if (c == '>')
11246  state = 0;
11247  else
11248  state = 3;
11249 
11250  *s++ = c;
11251  continue;
11252  }
11253 
11254  switch (c)
11255  {
11256  case '/':
11257 
11258  if (n > 0)
11259  {
11260  c = soap_getchar(soap);
11261 
11262  if (c == '>')
11263  n--;
11264 
11265  soap_unget(soap, c);
11266  }
11267 
11268  *s++ = '/';
11269  break;
11270  case '<':
11271  c = soap_getchar(soap);
11272 
11273  if (c == '/')
11274  {
11275  if (n == 0)
11276  {
11277  c = SOAP_TT;
11278  goto end;
11279  }
11280 
11281  n--;
11282  }
11283  else if (c == '!')
11284  {
11285  c = soap_getchar(soap);
11286 
11287  if (c == '[')
11288  {
11289  do c = soap_getchar(soap);
11290 
11291  while ((int)c != EOF && c != '[');
11292 
11293  if ((int)c == EOF)
11294  goto end;
11295 
11296  t = (char*)"![CDATA[";
11297  m = 8;
11298  state = 1;
11299  }
11300  else if (c == '-')
11301  {
11302  if ((c = soap_getchar(soap)) == '-')
11303  state = 2;
11304 
11305  t = (char*)"!-";
11306  m = 2;
11307  soap_unget(soap, c);
11308  }
11309  else
11310  {
11311  t = (char*)"!";
11312  m = 1;
11313  soap_unget(soap, c);
11314  }
11315 
11316  *s++ = '<';
11317  break;
11318  }
11319  else if (c == '?')
11320  state = 3;
11321  else
11322  n++;
11323 
11324  soap_unget(soap, c);
11325  *s++ = '<';
11326  break;
11327  case '>':
11328  *s++ = '>';
11329  break;
11330  case '"':
11331  *s++ = '"';
11332  break;
11333  default:
11334 #ifndef WITH_LEANER
11335 #ifdef HAVE_WCTOMB
11336 
11337  if (soap->mode & SOAP_C_MBSTRING)
11338  {
11339  m = wctomb(buf, c & 0x7FFFFFFF);
11340 
11341  if (m >= 1 && m <= (int)MB_CUR_MAX)
11342  {
11343  t = buf;
11344  *s++ = *t++;
11345  m--;
11346  }
11347  else
11348  {
11349  *s++ = SOAP_UNKNOWN_CHAR;
11350  m = 0;
11351  }
11352  }
11353  else
11354 #endif
11355 #endif
11356  *s++ = (char)(c & 0xFF);
11357  }
11358 
11359  l++;
11360 
11361  if ((soap->mode & SOAP_XML_STRICT) && maxlen >= 0 && l > maxlen)
11362  {
11363  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
11364  soap->error = SOAP_LENGTH;
11365  return NULL;
11366  }
11367  }
11368  }
11369  }
11370 
11371 #endif
11372 #ifdef WITH_FAST
11373  soap->labidx = 0; /* use look-aside buffer */
11374 #else
11375 
11376  if (soap_new_block(soap) == NULL)
11377  return NULL;
11378 
11379 #endif
11380 
11381  for (;;)
11382  {
11383 #ifdef WITH_FAST
11384  register size_t k;
11385 
11386  if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
11387  return NULL;
11388 
11389  s = soap->labbuf + soap->labidx; /* space to populate */
11390  k = soap->lablen - soap->labidx; /* number of bytes available */
11391  soap->labidx = soap->lablen; /* claim this space */
11392 #else
11393  register size_t k = SOAP_BLKLEN;
11394 
11395  if (!(s = (char*)soap_push_block(soap, NULL, k)))
11396  return NULL;
11397 
11398 #endif
11399 
11400  for (i = 0; i < k; i++)
11401  {
11402  if (m > 0)
11403  {
11404  *s++ = *t++; /* copy multibyte characters */
11405  m--;
11406  continue;
11407  }
11408 
11409  if (soap->mode & SOAP_C_UTFSTRING)
11410  {
11411  if (((c = soap_get(soap)) & 0x80000000) && c >= -0x7FFFFF80 && c < SOAP_AP)
11412  {
11413  c &= 0x7FFFFFFF;
11414  t = buf;
11415 
11416  if (c < 0x0800)
11417  *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
11418  else
11419  {
11420  if (c < 0x010000)
11421  *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
11422  else
11423  {
11424  if (c < 0x200000)
11425  *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
11426  else
11427  {
11428  if (c < 0x04000000)
11429  *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
11430  else
11431  {
11432  *t++ = (char)(0xFC | ((c >> 30) & 0x01));
11433  *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
11434  }
11435 
11436  *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
11437  }
11438 
11439  *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
11440  }
11441 
11442  *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
11443  }
11444 
11445  *t++ = (char)(0x80 | (c & 0x3F));
11446  m = (int)(t - buf) - 1;
11447  t = buf;
11448  *s++ = *t++;
11449  continue;
11450  }
11451  }
11452  else
11453  c = soap_getutf8(soap);
11454 
11455  switch (c)
11456  {
11457  case SOAP_TT:
11458 
11459  if (n == 0)
11460  goto end;
11461 
11462  n--;
11463  *s++ = '<';
11464  t = (char*)"/";
11465  m = 1;
11466  break;
11467  case SOAP_LT:
11468 
11469  if (f && n == 0)
11470  goto end;
11471 
11472  n++;
11473  *s++ = '<';
11474  break;
11475  case SOAP_GT:
11476  *s++ = '>';
11477  break;
11478  case SOAP_QT:
11479  *s++ = '"';
11480  break;
11481  case SOAP_AP:
11482  *s++ = '\'';
11483  break;
11484  case '/':
11485 
11486  if (n > 0)
11487  {
11488  c = soap_get(soap);
11489 
11490  if (c == SOAP_GT)
11491  n--;
11492 
11493  soap_unget(soap, c);
11494  }
11495 
11496  *s++ = '/';
11497  break;
11498  case(soap_wchar)('<' | 0x80000000):
11499 
11500  if (flag)
11501  *s++ = '<';
11502  else
11503  {
11504  *s++ = '&';
11505  t = (char*)"lt;";
11506  m = 3;
11507  }
11508 
11509  break;
11510  case(soap_wchar)('>' | 0x80000000):
11511 
11512  if (flag)
11513  *s++ = '>';
11514  else
11515  {
11516  *s++ = '&';
11517  t = (char*)"gt;";
11518  m = 3;
11519  }
11520 
11521  break;
11522  case(soap_wchar)('&' | 0x80000000):
11523 
11524  if (flag)
11525  *s++ = '&';
11526  else
11527  {
11528  *s++ = '&';
11529  t = (char*)"amp;";
11530  m = 4;
11531  }
11532 
11533  break;
11534  case(soap_wchar)('"' | 0x80000000):
11535 
11536  if (flag)
11537  *s++ = '"';
11538  else
11539  {
11540  *s++ = '&';
11541  t = (char*)"quot;";
11542  m = 5;
11543  }
11544 
11545  break;
11546  case(soap_wchar)('\'' | 0x80000000):
11547 
11548  if (flag)
11549  *s++ = '\'';
11550  else
11551  {
11552  *s++ = '&';
11553  t = (char*)"apos;";
11554  m = 5;
11555  }
11556 
11557  break;
11558  default:
11559 
11560  if ((int)c == EOF)
11561  goto end;
11562 
11563 #ifndef WITH_LEANER
11564 #ifdef HAVE_WCTOMB
11565 
11566  if (soap->mode & SOAP_C_MBSTRING)
11567  {
11568  m = wctomb(buf, c & 0x7FFFFFFF);
11569 
11570  if (m >= 1 && m <= (int)MB_CUR_MAX)
11571  {
11572  t = buf;
11573  *s++ = *t++;
11574  m--;
11575  }
11576  else
11577  {
11578  *s++ = SOAP_UNKNOWN_CHAR;
11579  m = 0;
11580  }
11581  }
11582  else
11583 #endif
11584 #endif
11585  *s++ = (char)(c & 0xFF);
11586  }
11587 
11588  l++;
11589 
11590  if ((soap->mode & SOAP_XML_STRICT) && maxlen >= 0 && l > maxlen)
11591  {
11592  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
11593  soap->error = SOAP_LENGTH;
11594  return NULL;
11595  }
11596  }
11597  }
11598 
11599 end:
11600  soap_unget(soap, c);
11601  *s = '\0';
11602 #ifdef WITH_FAST
11603  t = soap_strdup(soap, soap->labbuf);
11604 #else
11605  soap_size_block(soap, NULL, i + 1);
11606  t = soap_save_block(soap, NULL, 0);
11607 #endif
11608 
11609  if ((soap->mode & SOAP_XML_STRICT) && l < minlen)
11610  {
11611  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too short: %ld chars, minlen=%ld\n", l, minlen));
11612  soap->error = SOAP_LENGTH;
11613  return NULL;
11614  }
11615 
11616 #ifdef WITH_DOM
11617 
11618  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
11619  {
11620  if (flag == 3)
11621  soap->dom->tail = t;
11622  else
11623  soap->dom->data = t;
11624  }
11625 
11626 #endif
11627 
11628  if (flag == 2)
11629  if (soap_s2QName(soap, t, &t))
11630  return NULL;
11631 
11632  return t;
11633  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
size_t lablen
Definition: stdsoap2.h:1708
char tag[(1024)]
Definition: stdsoap2.h:1713
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
soap_wchar soap_get(struct soap *soap)
Definition: stdsoap2.cpp:1856
int error
Definition: stdsoap2.h:1755
#define SOAP_C_UTFSTRING
Definition: stdsoap2.h:1117
soap_mode mode
Definition: stdsoap2.h:1601
soap_wchar soap_getutf8(struct soap *soap)
Definition: stdsoap2.cpp:2143
#define SOAP_UNKNOWN_CHAR
Definition: stdsoap2.cpp:108
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_attribute * next
Definition: stdsoap2.h:1337
short peeked
Definition: stdsoap2.h:1731
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
struct soap_blist * soap_new_block(struct soap *soap)
Definition: stdsoap2.cpp:2728
int soap_s2QName(struct soap *soap, const char *s, char **t)
Definition: stdsoap2.cpp:13252
char * soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
Definition: stdsoap2.cpp:3179
#define SOAP_TT
Definition: stdsoap2.cpp:113
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
soap_wchar soap_getchar(struct soap *soap)
Definition: stdsoap2.cpp:1616
#define SOAP_BLKLEN
Definition: stdsoap2.h:841
#define SOAP_C_MBSTRING
Definition: stdsoap2.h:1118
size_t labidx
Definition: stdsoap2.h:1709
#define SOAP_QT
Definition: stdsoap2.cpp:115
char * labbuf
Definition: stdsoap2.h:1707
long int flag
Definition: f2c.h:52
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
#define SOAP_GT
Definition: stdsoap2.cpp:114
char name[1]
Definition: stdsoap2.h:1342
#define SOAP_AP
Definition: stdsoap2.cpp:116
int soap_append_lab(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:10289
void * soap_push_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:2752
#define SOAP_ENC_LATIN
Definition: stdsoap2.h:1097
size_t soap_size_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:3038
#define SOAP_LENGTH
Definition: stdsoap2.h:1040
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
short body
Definition: stdsoap2.h:1703
#define SOAP_LT
Definition: stdsoap2.cpp:112
int32_t soap_wchar
Definition: stdsoap2.h:1257
char * value
Definition: stdsoap2.h:1338
int soap_string_out ( struct soap ,
const char *  s,
int  flag 
)

Definition at line 10882 of file stdsoap2.cpp.

References soap_dom_element::data, soap::dom, soap::error, soap::mode, SOAP_C_MBSTRING, SOAP_C_UTFSTRING, SOAP_OK, soap_pututf8(), soap_send_raw(), soap_strdup(), SOAP_XML_CANONICAL, and SOAP_XML_DOM.

Referenced by soap_attribute(), soap_element_result(), soap_element_start_end_out(), soap_out_std__string(), soap_outbyte(), soap_outdateTime(), soap_outdouble(), soap_outfloat(), soap_outint(), soap_outlong(), soap_outLONG64(), soap_outshort(), soap_outstring(), soap_outULONG64(), soap_outunsignedByte(), soap_outunsignedInt(), soap_outunsignedLong(), and soap_outunsignedShort().

10883  {
10884  register const char *t;
10885  register soap_wchar c;
10886  register soap_wchar mask = (soap_wchar)0xFFFFFF80UL;
10887 #ifdef WITH_DOM
10888 
10889  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
10890  {
10891  soap->dom->data = soap_strdup(soap, s);
10892  return SOAP_OK;
10893  }
10894 
10895 #endif
10896 
10897  if (soap->mode & SOAP_C_UTFSTRING)
10898  mask = 0;
10899 
10900  t = s;
10901 
10902  while ((c = *t++))
10903  {
10904  switch (c)
10905  {
10906  case 0x09:
10907 
10908  if (flag)
10909  {
10910  if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&#x9;", 5))
10911  return soap->error;
10912 
10913  s = t;
10914  }
10915 
10916  break;
10917  case 0x0A:
10918 
10919  if (flag || !(soap->mode & SOAP_XML_CANONICAL))
10920  {
10921  if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&#xA;", 5))
10922  return soap->error;
10923 
10924  s = t;
10925  }
10926 
10927  break;
10928  case 0x0D:
10929 
10930  if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&#xD;", 5))
10931  return soap->error;
10932 
10933  s = t;
10934  break;
10935  case '&':
10936 
10937  if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&amp;", 5))
10938  return soap->error;
10939 
10940  s = t;
10941  break;
10942  case '<':
10943 
10944  if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&lt;", 4))
10945  return soap->error;
10946 
10947  s = t;
10948  break;
10949  case '>':
10950 
10951  if (!flag)
10952  {
10953  if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&gt;", 4))
10954  return soap->error;
10955 
10956  s = t;
10957  }
10958 
10959  break;
10960  case '"':
10961 
10962  if (flag)
10963  {
10964  if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&quot;", 6))
10965  return soap->error;
10966 
10967  s = t;
10968  }
10969 
10970  break;
10971  default:
10972 #ifndef WITH_LEANER
10973 #ifdef HAVE_MBTOWC
10974 
10975  if (soap->mode & SOAP_C_MBSTRING)
10976  {
10977  wchar_t wc;
10978  register int m = mbtowc(&wc, t - 1, MB_CUR_MAX);
10979 
10980  if (m > 0 && wc != c)
10981  {
10982  if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, wc))
10983  return soap->error;
10984 
10985  s = t += m - 1;
10986  continue;
10987  }
10988  }
10989 
10990 #endif
10991 #endif
10992 #ifndef WITH_NOSTRINGTOUTF8
10993 
10994  if ((c & mask) || !(c & 0xFFFFFFE0UL))
10995  {
10996  if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, (unsigned char)c))
10997  return soap->error;
10998 
10999  s = t;
11000  }
11001 
11002 #endif
11003  }
11004  }
11005 
11006  return soap_send_raw(soap, s, t - s - 1);
11007  }
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
#define SOAP_C_UTFSTRING
Definition: stdsoap2.h:1117
soap_mode mode
Definition: stdsoap2.h:1601
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
int soap_pututf8(struct soap *soap, register unsigned long c)
Definition: stdsoap2.cpp:2082
#define SOAP_C_MBSTRING
Definition: stdsoap2.h:1118
long int flag
Definition: f2c.h:52
#define SOAP_OK
Definition: stdsoap2.h:995
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
int32_t soap_wchar
Definition: stdsoap2.h:1257
const char* soap_strsearch ( const char *  big,
const char *  little 
)

Definition at line 8869 of file stdsoap2.cpp.

Referenced by soap_push_ns().

8870  {
8871  register size_t n = strlen(little);
8872  register const char *s = big;
8873 
8874  while (s)
8875  {
8876  if (!strncmp(s, little, n) && (s[n] == '\0' || s[n] == ' '))
8877  return s;
8878 
8879  s = strchr(s, ' ');
8880 
8881  if (s)
8882  s++;
8883  }
8884 
8885  return NULL;
8886  }
int soap_tag_cmp ( const char *  ,
const char *   
)

Definition at line 3657 of file stdsoap2.cpp.

References soap_tag_cmp().

Referenced by http_parse_header(), http_post(), soap_code_int(), soap_get_header_attribute(), soap_get_pi(), soap_getmimehdr(), soap_push_namespace(), soap_QName2s(), soap_s2double(), soap_s2float(), soap_set_endpoint(), soap_tag_cmp(), and tcp_connect().

3658  {
3659  for (;;)
3660  {
3661  register int c1 = *s;
3662  register int c2 = *t;
3663 
3664  if (!c1 || c1 == '"')
3665  break;
3666 
3667  if (c2 != '-')
3668  {
3669  if (c1 != c2)
3670  {
3671  if (c1 >= 'A' && c1 <= 'Z')
3672  c1 += 'a' - 'A';
3673 
3674  if (c2 >= 'A' && c2 <= 'Z')
3675  c2 += 'a' - 'A';
3676  }
3677 
3678  if (c1 != c2)
3679  {
3680  if (c2 != '*')
3681  return 1;
3682 
3683  c2 = *++t;
3684 
3685  if (!c2)
3686  return 0;
3687 
3688  if (c2 >= 'A' && c2 <= 'Z')
3689  c2 += 'a' - 'A';
3690 
3691  for (;;)
3692  {
3693  c1 = *s;
3694 
3695  if (!c1 || c1 == '"')
3696  break;
3697 
3698  if (c1 >= 'A' && c1 <= 'Z')
3699  c1 += 'a' - 'A';
3700 
3701  if (c1 == c2 && !soap_tag_cmp(s + 1, t + 1))
3702  return 0;
3703 
3704  s++;
3705  }
3706 
3707  break;
3708  }
3709  }
3710 
3711  s++;
3712  t++;
3713  }
3714 
3715  if (*t == '*' && !t[1])
3716  return 0;
3717 
3718  return *t;
3719  }
int soap_tag_cmp(const char *s, const char *t)
Definition: stdsoap2.cpp:3657
size_t soap_tell ( struct soap )

Definition at line 2070 of file stdsoap2.cpp.

References soap::ahead, soap::bufidx, soap::buflen, and soap::count.

Referenced by soap_getdime(), and soap_getdimehdr().

2071  {
2072  return soap->count - soap->buflen + soap->bufidx - (soap->ahead != 0);
2073  }
soap_wchar ahead
Definition: stdsoap2.h:1701
size_t bufidx
Definition: stdsoap2.h:1699
size_t buflen
Definition: stdsoap2.h:1700
size_t count
Definition: stdsoap2.h:1705
time_t soap_timegm ( struct tm *  )

Definition at line 13761 of file stdsoap2.cpp.

Referenced by soap_s2dateTime().

13762  {
13763 #if defined(HAVE_TIMEGM)
13764  return timegm(T);
13765 #else
13766  time_t t, g, z;
13767  struct tm tm;
13768  t = mktime(T);
13769 
13770  if (t == (time_t) - 1)
13771  return (time_t) - 1;
13772 
13773 #ifdef HAVE_GMTIME_R
13774  gmtime_r(&t, &tm);
13775 #else
13776  tm = *gmtime(&t);
13777 #endif
13778  tm.tm_isdst = 0;
13779  g = mktime(&tm);
13780 
13781  if (g == (time_t) - 1)
13782  return (time_t) - 1;
13783 
13784  z = g - t;
13785  return t - z;
13786 #endif
13787  }
void soap_track_free ( struct soap ,
const char *  ,
int  ,
void  
)
void* soap_track_malloc ( struct soap ,
const char *  ,
int  ,
size_t   
)
const char* soap_ULONG642s ( struct soap ,
unsigned long  long 
)

Definition at line 13126 of file stdsoap2.cpp.

References SOAP_ULONG_FORMAT, and soap::tmpbuf.

Referenced by soap_outULONG64().

13127  {
13128  sprintf(soap->tmpbuf, SOAP_ULONG_FORMAT, n);
13129  return soap->tmpbuf;
13130  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
#define SOAP_ULONG_FORMAT
Definition: stdsoap2.h:750
void soap_unlink ( struct soap ,
const void  
)

Definition at line 7403 of file stdsoap2.cpp.

References soap::alist, soap::clist, DBGLOG, soap_clist::next, and SOAP_FREE.

7404  {
7405  register char **q;
7406  register struct soap_clist **cp;
7407 
7408  if (!soap || !p)
7409  return;
7410 
7411  for (q = (char**) & soap->alist; *q; q = *(char***)q)
7412  {
7413  if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*))))
7414  {
7415  *q = **(char***)q;
7416  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked data %p\n", p));
7417 #ifdef SOAP_MEM_DEBUG
7418  soap_track_unlink(soap, p);
7419 #endif
7420  return;
7421  }
7422  }
7423 
7424  for (cp = &soap->clist; *cp; cp = &(*cp)->next)
7425  {
7426  if (p == (*cp)->ptr)
7427  {
7428  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked class instance %p\n", p));
7429  q = (char**) * cp;
7430  *cp = (*cp)->next;
7431  SOAP_FREE(soap, q);
7432  return;
7433  }
7434  }
7435  }
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_clist * clist
Definition: stdsoap2.h:1625
void * alist
Definition: stdsoap2.h:1626
#define SOAP_FREE(soap, ptr)
Definition: stdsoap2.h:1194
struct soap_clist * next
Definition: stdsoap2.h:1327
const char* soap_unsignedByte2s ( struct soap ,
unsigned  char 
)

Definition at line 12752 of file stdsoap2.cpp.

References soap_unsignedLong2s().

12753  {
12754  return soap_unsignedLong2s(soap, (unsigned long)n);
12755  }
const char * soap_unsignedLong2s(struct soap *soap, unsigned long n)
Definition: stdsoap2.cpp:13027
const char* soap_unsignedInt2s ( struct soap ,
unsigned  int 
)

Definition at line 12929 of file stdsoap2.cpp.

References soap_unsignedLong2s().

12930  {
12931  return soap_unsignedLong2s(soap, (unsigned long)n);
12932  }
const char * soap_unsignedLong2s(struct soap *soap, unsigned long n)
Definition: stdsoap2.cpp:13027
const char* soap_unsignedLong2s ( struct soap ,
unsigned  long 
)

Definition at line 13027 of file stdsoap2.cpp.

References soap::tmpbuf.

Referenced by soap_outunsignedByte(), soap_outunsignedInt(), soap_outunsignedLong(), soap_outunsignedShort(), soap_unsignedByte2s(), soap_unsignedInt2s(), and soap_unsignedShort2s().

13028  {
13029  sprintf(soap->tmpbuf, "%lu", n);
13030  return soap->tmpbuf;
13031  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
const char* soap_unsignedShort2s ( struct soap ,
unsigned  short 
)

Definition at line 12840 of file stdsoap2.cpp.

References soap_unsignedLong2s().

12841  {
12842  return soap_unsignedLong2s(soap, (unsigned long)n);
12843  }
const char * soap_unsignedLong2s(struct soap *soap, unsigned long n)
Definition: stdsoap2.cpp:13027
const char* soap_value ( struct soap )

Definition at line 14238 of file stdsoap2.cpp.

References soap::body, soap_dom_element::data, DBGLOG, soap::dom, soap::mode, soap_blank, soap_get(), SOAP_STR_EOS, soap_strdup(), SOAP_TT, soap_unget, SOAP_XML_DOM, and soap::tmpbuf.

Referenced by soap_inbyte(), soap_indateTime(), soap_indouble(), soap_infloat(), soap_inint(), soap_inlong(), soap_inLONG64(), soap_inshort(), soap_inULONG64(), soap_inunsignedByte(), soap_inunsignedInt(), soap_inunsignedLong(), and soap_inunsignedShort().

14239  {
14240  register size_t i;
14241  register soap_wchar c = 0;
14242  register char *s = soap->tmpbuf;
14243 
14244  if (!soap->body)
14245  return SOAP_STR_EOS;
14246 
14247  do c = soap_get(soap);
14248 
14249  while (soap_blank(c));
14250 
14251  for (i = 0; i < sizeof(soap->tmpbuf) - 1; i++)
14252  {
14253  if (c == SOAP_TT || (int)c == EOF)
14254  break;
14255 
14256  *s++ = (char)c;
14257  c = soap_get(soap);
14258  }
14259 
14260  for (s--; i > 0; i--, s--)
14261  {
14262  if (!soap_blank(*s))
14263  break;
14264  }
14265 
14266  s[1] = '\0';
14267 
14268  if ((int)c == EOF || c == SOAP_TT)
14269  soap_unget(soap, c);
14270 
14271  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element content value='%s'\n", soap->tmpbuf));
14272 #ifdef WITH_DOM
14273 
14274  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
14276 
14277 #endif
14278  return soap->tmpbuf; /* return non-null pointer */
14279  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
soap_wchar soap_get(struct soap *soap)
Definition: stdsoap2.cpp:1856
soap_mode mode
Definition: stdsoap2.h:1601
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
#define soap_blank(c)
Definition: stdsoap2.cpp:118
#define SOAP_TT
Definition: stdsoap2.cpp:113
#define SOAP_STR_EOS
Definition: stdsoap2.cpp:310
char * soap_strdup(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:2688
short body
Definition: stdsoap2.h:1703
int32_t soap_wchar
Definition: stdsoap2.h:1257
const char* soap_wchar2s ( struct soap ,
const wchar_t *   
)

Definition at line 13531 of file stdsoap2.cpp.

References soap_malloc().

13532  {
13533  register soap_wchar c;
13534  register char *r, *t;
13535  const wchar_t *q = s;
13536  size_t n = 0;
13537 
13538  while ((c = *q++))
13539  {
13540  if (c > 0 && c < 0x80)
13541  n++;
13542  else
13543  n += 6;
13544  }
13545 
13546  r = t = (char*)soap_malloc(soap, n + 1);
13547 
13548  if (r)
13549  {/* Convert wchar to UTF8 */
13550  while ((c = *s++))
13551  {
13552  if (c > 0 && c < 0x80)
13553  * t++ = (char)c;
13554  else
13555  {
13556  if (c < 0x0800)
13557  *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
13558  else
13559  {
13560  if (c < 0x010000)
13561  *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
13562  else
13563  {
13564  if (c < 0x200000)
13565  *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
13566  else
13567  {
13568  if (c < 0x04000000)
13569  *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
13570  else
13571  {
13572  *t++ = (char)(0xFC | ((c >> 30) & 0x01));
13573  *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
13574  }
13575 
13576  *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
13577  }
13578 
13579  *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
13580  }
13581 
13582  *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
13583  }
13584 
13585  *t++ = (char)(0x80 | (c & 0x3F));
13586  }
13587  }
13588 
13589  *t = '\0';
13590  }
13591 
13592  return r;
13593  }
int32_t soap_wchar
Definition: stdsoap2.h:1257
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
wchar_t* soap_wstrdup ( struct soap ,
const wchar_t *   
)

Definition at line 2704 of file stdsoap2.cpp.

References soap_malloc().

Referenced by soap_inwliteral(), and soap_inwstring().

2705  {
2706  wchar_t *t = NULL;
2707 
2708  if (s)
2709  {
2710  size_t n = 0;
2711 
2712  while (s[n])
2713  n++;
2714 
2715  if ((t = (wchar_t*)soap_malloc(soap, sizeof(wchar_t) * (n + 1))))
2716  memcpy(t, s, sizeof(wchar_t) * (n + 1));
2717  }
2718 
2719  return t;
2720  }
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
wchar_t* soap_wstring_in ( struct soap ,
int  ,
long  ,
long   
)

Definition at line 11742 of file stdsoap2.cpp.

References soap::attributes, soap::body, DBGLOG, soap::dom, soap::error, soap::mode, soap_attribute::name, soap_attribute::next, soap::peeked, SOAP_AP, SOAP_BLKLEN, soap_getutf8(), SOAP_GT, SOAP_LENGTH, SOAP_LT, soap_new_block(), soap_push_block(), SOAP_QT, soap_save_block(), soap_size_block(), SOAP_TT, soap_unget, SOAP_XML_DOM, SOAP_XML_STRICT, soap::tag, soap::tmpbuf, soap_attribute::value, soap_attribute::visible, and soap_dom_element::wide.

Referenced by soap_inwliteral(), and soap_inwstring().

11743  {
11744  wchar_t *s;
11745  register int i, n = 0, f = 0;
11746  register long l = 0;
11747  register soap_wchar c;
11748  char *t = NULL;
11749  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reading wide string content\n"));
11750 
11751  if (soap->peeked)
11752  {
11753  if (*soap->tag)
11754  {
11755 #ifndef WITH_LEAN
11756  struct soap_attribute *tp;
11757  t = soap->tmpbuf;
11758  *t = '<';
11759  t[sizeof(soap->tmpbuf) - 1] = '\0';
11760  strncpy(t + 1, soap->tag, sizeof(soap->tmpbuf) - 2);
11761  t += strlen(t);
11762 
11763  for (tp = soap->attributes; tp; tp = tp->next)
11764  {
11765  if (tp->visible)
11766  {
11767  if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
11768  break;
11769 
11770  *t++ = ' ';
11771  strcpy(t, tp->name);
11772  t += strlen(t);
11773 
11774  if (t >= soap->tmpbuf + sizeof(soap->tmpbuf) - 2)
11775  break;
11776 
11777  if (tp->value)
11778  {
11779  *t++ = '=';
11780  *t++ = '"';
11781  strcpy(t, tp->value);
11782  t += strlen(t);
11783  *t++ = '"';
11784  }
11785  }
11786  }
11787 
11788  if (!soap->body)
11789  *t++ = '/';
11790 
11791  *t++ = '>';
11792  *t = '\0';
11793  t = soap->tmpbuf;
11794 #endif
11795 
11796  if (soap->body)
11797  n = 1;
11798 
11799  f = 1;
11800  soap->peeked = 0;
11801  }
11802  }
11803 
11804  if (soap_new_block(soap) == NULL)
11805  return NULL;
11806 
11807  for (;;)
11808  {
11809  if (!(s = (wchar_t*)soap_push_block(soap, NULL, sizeof(wchar_t) * SOAP_BLKLEN)))
11810  return NULL;
11811 
11812  for (i = 0; i < SOAP_BLKLEN; i++)
11813  {
11814  if (t)
11815  {
11816  *s++ = (wchar_t) * t++;
11817 
11818  if (!*t)
11819  t = NULL;
11820 
11821  continue;
11822  }
11823 
11824  c = soap_getutf8(soap);
11825 
11826  switch (c)
11827  {
11828  case SOAP_TT:
11829 
11830  if (n == 0)
11831  goto end;
11832 
11833  n--;
11834  *s++ = '<';
11835  soap_unget(soap, '/');
11836  break;
11837  case SOAP_LT:
11838 
11839  if (f && n == 0)
11840  goto end;
11841 
11842  n++;
11843  *s++ = '<';
11844  break;
11845  case SOAP_GT:
11846  *s++ = '>';
11847  break;
11848  case SOAP_QT:
11849  *s++ = '"';
11850  break;
11851  case SOAP_AP:
11852  *s++ = '\'';
11853  break;
11854  case '/':
11855 
11856  if (n > 0)
11857  {
11858  c = soap_getutf8(soap);
11859 
11860  if (c == SOAP_GT)
11861  n--;
11862 
11863  soap_unget(soap, c);
11864  }
11865 
11866  *s++ = '/';
11867  break;
11868  case '<':
11869 
11870  if (flag)
11871  *s++ = (soap_wchar)'<';
11872  else
11873  {
11874  *s++ = (soap_wchar)'&';
11875  t = (char*)"lt;";
11876  }
11877 
11878  break;
11879  case '>':
11880 
11881  if (flag)
11882  *s++ = (soap_wchar)'>';
11883  else
11884  {
11885  *s++ = (soap_wchar)'&';
11886  t = (char*)"gt;";
11887  }
11888 
11889  break;
11890  case '"':
11891 
11892  if (flag)
11893  *s++ = (soap_wchar)'"';
11894  else
11895  {
11896  *s++ = (soap_wchar)'&';
11897  t = (char*)"quot;";
11898  }
11899 
11900  break;
11901  default:
11902 
11903  if ((int)c == EOF)
11904  goto end;
11905 
11906  *s++ = (wchar_t)c & 0x7FFFFFFF;
11907  }
11908 
11909  l++;
11910 
11911  if ((soap->mode & SOAP_XML_STRICT) && maxlen >= 0 && l > maxlen)
11912  {
11913  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too long: maxlen=%ld\n", maxlen));
11914  soap->error = SOAP_LENGTH;
11915  return NULL;
11916  }
11917  }
11918  }
11919 
11920 end:
11921  soap_unget(soap, c);
11922  *s = '\0';
11923  soap_size_block(soap, NULL, sizeof(wchar_t) *(i + 1));
11924 
11925  if ((soap->mode & SOAP_XML_STRICT) && l < minlen)
11926  {
11927  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "String too short: %ld chars, minlen=%ld\n", l, minlen));
11928  soap->error = SOAP_LENGTH;
11929  return NULL;
11930  }
11931 
11932  s = (wchar_t*)soap_save_block(soap, NULL, NULL, 0);
11933 #ifdef WITH_DOM
11934 
11935  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
11936  soap->dom->wide = s;
11937 
11938 #endif
11939  return s;
11940  }
char tmpbuf[1024]
Definition: stdsoap2.h:1712
char tag[(1024)]
Definition: stdsoap2.h:1713
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
soap_wchar soap_getutf8(struct soap *soap)
Definition: stdsoap2.cpp:2143
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define DBGLOG(DBGFILE, CMD)
Definition: stdsoap2.h:1247
struct soap_attribute * next
Definition: stdsoap2.h:1337
short peeked
Definition: stdsoap2.h:1731
#define soap_unget(soap, c)
Definition: stdsoap2.h:1900
struct soap_blist * soap_new_block(struct soap *soap)
Definition: stdsoap2.cpp:2728
char * soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
Definition: stdsoap2.cpp:3179
#define SOAP_TT
Definition: stdsoap2.cpp:113
#define SOAP_XML_STRICT
Definition: stdsoap2.h:1107
#define SOAP_BLKLEN
Definition: stdsoap2.h:841
#define SOAP_QT
Definition: stdsoap2.cpp:115
long int flag
Definition: f2c.h:52
struct soap_attribute * attributes
Definition: stdsoap2.h:1724
#define SOAP_GT
Definition: stdsoap2.cpp:114
char name[1]
Definition: stdsoap2.h:1342
#define SOAP_AP
Definition: stdsoap2.cpp:116
void * soap_push_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:2752
size_t soap_size_block(struct soap *soap, struct soap_blist *b, size_t n)
Definition: stdsoap2.cpp:3038
#define SOAP_LENGTH
Definition: stdsoap2.h:1040
wchar_t * wide
Definition: stdsoap2.h:1545
short body
Definition: stdsoap2.h:1703
#define SOAP_LT
Definition: stdsoap2.cpp:112
int32_t soap_wchar
Definition: stdsoap2.h:1257
char * value
Definition: stdsoap2.h:1338
int soap_wstring_out ( struct soap ,
const wchar_t *  s,
int  flag 
)

Definition at line 11642 of file stdsoap2.cpp.

References soap::dom, soap::error, soap::mode, soap_malloc(), SOAP_OK, soap_pututf8(), soap_send(), soap_send_raw(), SOAP_XML_CANONICAL, SOAP_XML_DOM, and soap_dom_element::wide.

Referenced by soap_outwstring().

11643  {
11644  const char *t;
11645  char tmp;
11646  register soap_wchar c;
11647 #ifdef WITH_DOM
11648 
11649  if ((soap->mode & SOAP_XML_DOM) && soap->dom)
11650  {
11651  wchar_t *r = (wchar_t*)s;
11652  int n = 1;
11653 
11654  while (*r++)
11655  n++;
11656 
11657  soap->dom->wide = r = (wchar_t*)soap_malloc(soap, n * sizeof(wchar_t));
11658 
11659  while (n--)
11660  *r++ = *s++;
11661 
11662  return SOAP_OK;
11663  }
11664 
11665 #endif
11666 
11667  while ((c = *s++))
11668  {
11669  switch (c)
11670  {
11671  case 0x09:
11672 
11673  if (flag)
11674  t = "&#x9;";
11675  else
11676  t = "\t";
11677 
11678  break;
11679  case 0x0A:
11680 
11681  if (flag || !(soap->mode & SOAP_XML_CANONICAL))
11682  t = "&#xA;";
11683  else
11684  t = "\n";
11685 
11686  break;
11687  case 0x0D:
11688  t = "&#xD;";
11689  break;
11690  case '&':
11691  t = "&amp;";
11692  break;
11693  case '<':
11694  t = "&lt;";
11695  break;
11696  case '>':
11697 
11698  if (flag)
11699  t = ">";
11700  else
11701  t = "&gt;";
11702 
11703  break;
11704  case '"':
11705 
11706  if (flag)
11707  t = "&quot;";
11708  else
11709  t = "\"";
11710 
11711  break;
11712  default:
11713 
11714  if (c >= 0x20 && c < 0x80)
11715  {
11716  tmp = (char)c;
11717 
11718  if (soap_send_raw(soap, &tmp, 1))
11719  return soap->error;
11720  }
11721  else if (soap_pututf8(soap, (unsigned long)c))
11722  return soap->error;
11723 
11724  continue;
11725  }
11726 
11727  if (soap_send(soap, t))
11728  return soap->error;
11729  }
11730 
11731  return SOAP_OK;
11732  }
struct soap_dom_element * dom
Definition: stdsoap2.h:1759
int error
Definition: stdsoap2.h:1755
soap_mode mode
Definition: stdsoap2.h:1601
int soap_send_raw(struct soap *soap, const char *s, size_t n)
Definition: stdsoap2.cpp:815
#define SOAP_XML_DOM
Definition: stdsoap2.h:1113
#define SOAP_XML_CANONICAL
Definition: stdsoap2.h:1109
int soap_send(struct soap *soap, const char *s)
Definition: stdsoap2.cpp:959
int soap_pututf8(struct soap *soap, register unsigned long c)
Definition: stdsoap2.cpp:2082
long int flag
Definition: f2c.h:52
#define SOAP_OK
Definition: stdsoap2.h:995
wchar_t * wide
Definition: stdsoap2.h:1545
int32_t soap_wchar
Definition: stdsoap2.h:1257
void * soap_malloc(struct soap *soap, size_t n)
Definition: stdsoap2.cpp:7080
int soap_xop_forward ( struct soap ,
unsigned char **  ,
int *  ,
char **  ,
char **  ,
char **   
)

Definition at line 2624 of file stdsoap2.cpp.

References soap::body, soap::error, soap::href, soap_dime_forward(), soap_element_begin_in(), soap_element_end_in(), SOAP_OK, and soap_peek_element().

2625  {/* Check MTOM xop:Include element (within hex/base64Binary) */
2626  /* TODO: this code to be obsoleted with new import/xop.h conventions */
2627  int body = soap->body; /* should save type too? */
2628 
2629  if (!soap_peek_element(soap))
2630  {
2631  if (!soap_element_begin_in(soap, "xop:Include", 0, NULL) && *soap->href)
2632  {
2633  if (soap_dime_forward(soap, ptr, size, id, type, options))
2634  return soap->error;
2635  }
2636 
2637  if (soap->body && soap_element_end_in(soap, NULL))
2638  return soap->error;
2639  }
2640 
2641  soap->body = body;
2642  return SOAP_OK;
2643  }
int soap_peek_element(struct soap *soap)
Definition: stdsoap2.cpp:10336
int error
Definition: stdsoap2.h:1755
int soap_element_begin_in(struct soap *soap, const char *tag, int nillable, const char *type)
Definition: stdsoap2.cpp:9864
char href[(1024)]
Definition: stdsoap2.h:1715
int soap_element_end_in(struct soap *soap, const char *tag)
Definition: stdsoap2.cpp:9902
#define SOAP_OK
Definition: stdsoap2.h:995
short body
Definition: stdsoap2.h:1703
int soap_dime_forward(struct soap *soap, unsigned char **ptr, int *size, char **id, char **type, char **options)
Definition: stdsoap2.cpp:2653

Variable Documentation

struct Namespace namespaces[]

Referenced by soap_init().